conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Move SC-related migrations to a separate directory; fix precision of EXPRESSION_LEVEL to be consistent with the rest of the schema (see atlas3-schema-postgres.sql)\n" }, { "from": "gpt", "value": "-- Table for storing single cell expression levels\nDROP TABLE SINGLE_...
sql
chosen
[ { "from": "system", "value": "Revert \"Spelling error of the century\"\n\nYou don't attempt to rename \"A\" to \"A\" in the database. Doing so breaks\nthe patch. Restore the intended functionality \"A\" to \"B\".\n\nYou also shouldn't be using Windows newlines.\n\nThis reverts commit aa61832a73bac8e1045b70a...
sql
chosen
[ { "from": "human", "value": "Add database patch for oauth_consumer flag.\n" }, { "from": "gpt", "value": "-- Add a flag to oauth consumers to indicate whether\n-- this key can be used with a grant_type of \"password\"\n\nALTER TABLE `oauth_consumers` ADD `enable_password_grant` TINYINT(1) DEFAUL...
sql
chosen
[ { "from": "human", "value": "Switch to 10 SMR credits per dollar.\n" }, { "from": "gpt", "value": "UPDATE account_has_credits\nSET credits_left = credits_left * 10,\n\treward_credits = reward_credits * 10;\nUPDATE bounty\nSET smr_credits = smr_credits * 10;" } ]
sql
chosen
[ { "from": "human", "value": "Add index on owning application for subscription table\n" }, { "from": "gpt", "value": "SET ROLE zalando_nakadi_data_owner;\n\nCREATE INDEX CONCURRENTLY subscription_owning_app_idx ON zn_data.subscription ((s_subscription_object ->> 'owning_application'));\n" } ]
sql
chosen
[ { "from": "human", "value": "Add defense station for SMS round" }, { "from": "gpt", "value": "INSERT INTO planet_type (planet_type_id, planet_type_name, planet_type_description, planet_image_link, planet_max_attackers, planet_max_landed) VALUES\r\n(4, \r\n'Defense World', \r\n'A fully armed and ...
sql
chosen
[ { "from": "human", "value": "Add migration for needed updated_at fields for salary table\n" }, { "from": "gpt", "value": "ALTER TABLE salary\nADD COLUMN UpdatedAt timestamp NOT NULL,\nADD COLUMN UpdatedBy int(11) NOT NULL,\nMODIFY COLUMN LockedDate timestamp;\nUPDATE salary\nSET UpdatedBy = Crea...
sql
chosen
[ { "from": "human", "value": "ENH: Add a sql script to create a repository table and a project2repositories relational table.\n" }, { "from": "gpt", "value": "-- --------------------------------------------------------\n\n--\n-- Table structure for table `repositories`\n--\n\nCREATE TABLE IF NOT ...
sql
chosen
[ { "from": "human", "value": "Add Pg/SQL recursor return samples\n" }, { "from": "gpt", "value": " -- Procedure that returns multiple result sets (cursors)\n CREATE OR REPLACE FUNCTION show_cur(num INTEGER) RETURNS SETOF refcursor AS $$\n DECLARE\n r_cur refcursor; -- Declare ...
sql
chosen
[ { "from": "system", "value": "Make null function test more interesting.\n" }, { "from": "human", "value": "SELECT name, order_date\n FROM customers INNER JOIN orders ON customers.cid = orders.cid\n WHERE name = SUBSTR(NULL, 10, 11)\n" }, { "from": "gpt", "value": "SELECT name, order...
sql
chosen
[ { "from": "human", "value": "Patch for release 85 adding a confident_relationship flag to the closure table\n" }, { "from": "gpt", "value": "-- Copyright [1999-2016] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute\n-- \n-- Licensed under the Apache License, Version...
sql
chosen
[ { "from": "human", "value": "[FIX] installer: Duplicate sefurl trackeritem regex fixer schema as, in at least one tiki, it failed to run leading to tracker items all ending up with just 'item' as the link (thanks marclaporte)\n\ngit-svn-id: bf8acf6ea2e0c2f171d9237652733ab0075b5b4c@46545 b456876b-0849-0410-b...
sql
chosen
[ { "from": "human", "value": "[A] Backup de la BD actual\n" }, { "from": "gpt", "value": "Usage: mysqldump [OPTIONS] database [tables]\nOR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]\nOR mysqldump [OPTIONS] --all-databases [OPTIONS]\nFor more options, use mysqldump --help\n...
sql
chosen
[ { "from": "system", "value": "Comment out this migration, will need to run manually in prod\n" }, { "from": "human", "value": "DROP TRIGGER IF EXISTS trg_tag_stat_inc;\nDROP TRIGGER IF EXISTS trg_tag_stat_dec;\n\n" }, { "from": "gpt", "value": "-- You've got to have SUPER to run thes...
sql
chosen
[ { "from": "human", "value": "Add facility type column for coldchain equipment report\n" }, { "from": "gpt", "value": "\n DROP VIEW IF EXISTS vw_cold_chain_equipment;\n\nCREATE OR REPLACE VIEW vw_cold_chain_equipment AS\n SELECT nested.id AS equipmentid,\n nested.manufacturer,\n nested.mod...
sql
chosen
[ { "from": "human", "value": "Update toolbar config for light bg\n" }, { "from": "gpt", "value": "-- update all non-publish(ed) views to have toolbar config;\nupdate portti_view_bundle_seq set config='{\n \"viewtools\": {\"link\":false},\n \"colours\": {\n \"hover\": \"#009FE3\",\n \"ba...
sql
chosen
[ { "from": "human", "value": "Patch to allow storage of frequency submitter handle as well as variant observation submitter handle\n" }, { "from": "gpt", "value": "# update the transcript_variation table\n##################\n\n\nALTER TABLE allele ADD COLUMN frequency_submitter_handle varchar(20...
sql
chosen
[ { "from": "human", "value": "[MOD] Add a commonly used sql script which mainly disables https for local use, but also removes minify etc to assist with debugging\n\ngit-svn-id: a7fabbc6a7c54ea5c67cbd16bd322330fd10cc35@64161 b456876b-0849-0410-b77d-98878d47e9d5\n" }, { "from": "gpt", "value": "/*...
sql
chosen
[ { "from": "human", "value": "Exclude private comment ratings from the average comment rating for a talk\n" }, { "from": "gpt", "value": "-- Drop the function if it exists\nDROP FUNCTION IF EXISTS get_talk_rating;\n\n\n-- Create get_talk_rating function that takes into account ratings that should...
sql
chosen
[ { "from": "human", "value": "[KULRICE-12713] Add created date to demo travel account records.\n" }, { "from": "gpt", "value": "--\r\n-- Copyright 2005-2014 The Kuali Foundation\r\n--\r\n-- Licensed under the Educational Community License, Version 2.0 (the \"License\");\r\n-- you may not use this...
sql
chosen
[ { "from": "human", "value": "Add Suspect Database Pages script\n" }, { "from": "gpt", "value": "/*\nAuthor: Ben Snaidero\nOriginal link: https://www.mssqltips.com/sqlservertip/4166/automate-alerting-for-sql-server-suspect-database-pages/\n*/\n\nSELECT sp.database_id AS DatabaseID\n , d.name ...
sql
chosen
[ { "from": "human", "value": "Add region-prefix config for TK layers\n" }, { "from": "gpt", "value": "UPDATE oskari_statistical_layer SET config = '{\"regionType\":\"seutukunta\", \"valueProcessor\": \"fi.nls.oskari.control.statistics.plugins.pxweb.parser.PrefixedRegionsValueProcessor\", \"statsR...
sql
chosen
[ { "from": "human", "value": "Add a migration script for the existing Atlas database\n" }, { "from": "gpt", "value": "/* Copied from awa-jobs-mysql.sql*/\n/* File generated automatically by dynamo */\n/* The job is associated with a dispatching queue. */\nCREATE TABLE awa_job (\n /* the job iden...
sql
chosen
[ { "from": "human", "value": "[FIND-969] Add the MariaDB migration script\n\n[rev: ivo.miller]\n" }, { "from": "gpt", "value": "/*-------------------------------------------\n-- Description: Add username column to\n Users table.\n\n-- Previous Version: 11.4.0.0\n-- Target Version: 11.4.0.1\n--...
sql
chosen
[ { "from": "human", "value": "Change type of timestamp columns\n\nThe type of columns creation_date, modification_date and\npublication_date is being changed from timestamp to timestamp with\ntimezone.\n" }, { "from": "gpt", "value": "CREATE FUNCTION alter_timestamps() RETURNS void AS $$\nDECLARE...
sql
chosen
[ { "from": "human", "value": "Add a pgSQL solution for problem 5\n" }, { "from": "gpt", "value": "\\timing\nWITH RECURSIVE ints(n) AS (\n values (20)\nunion all\n select n + 20 from ints\n)\n\n\nselect *\nfrom ints\nwhere ints.n NOT IN (\n SELECT ints.n\n FROM generate_series(20, 1, -1) gs(i)...
sql
chosen
[ { "from": "human", "value": "Update evolutions, adding logical name to asset meta\n" }, { "from": "gpt", "value": "# --- Add logical name of disks to asset meta\n\n# --- !Ups\n\nINSERT INTO asset_meta (name, priority, label, description) VALUES ('DISK_LOGICAL_NAME', -1, 'Disk logical name', 'The...
sql
chosen
[ { "from": "human", "value": "Create : 178 Rank Scores\n" }, { "from": "gpt", "value": "SELECT\n s1.score Score,\n COUNT(DISTINCT s2.score) Rank\nFROM\n Scores s1\n INNER JOIN Scores s2\n ON s1.score <= s2.score\nGROUP BY\n s1.id\nORDER BY\n s1.score DESC\n;\n" } ]
sql
chosen
[ { "from": "system", "value": "Switch to using numeric for money\n\nNow's not the time to innovate.\n" }, { "from": "human", "value": "BEGIN;\n ALTER TABLE participants ADD COLUMN paypal_fee_cap int;\n UPDATE participants SET paypal_fee_cap=20 WHERE paypal_email IS NOT NULL;\nEND;\n" }, ...
sql
chosen
[ { "from": "human", "value": "Put student schedule export from John Breslin under source control\n" }, { "from": "gpt", "value": "use x2data\nSELECT\n 'local_id', -- LASID\n 'course_number',\n 'COURSE_DESCRIPTION',\n 'SCHOOL_ID',\n 'STF_ID_LOCAL',\n 'MST_COURSE_VIEW',\n 'MST_TERM_VIEW',\n ...
sql
chosen
[ { "from": "human", "value": "Replace weapon in No Shields Inc 2\n\nThe Ik-Thorne Cluster Missile (an armour-only weapon) was being sold\nat No Shields Inc 2 (a weapon shop designed to sell only shields\nweapons).\n\nWe replace this weapon with the Ik-Thorne Accoustic Jammer, which is\na shields-only weapon ...
sql
chosen
[ { "from": "human", "value": "Prepare the migration from AWA 0.3 to 0.4\n" }, { "from": "gpt", "value": "ALTER TABLE awa_access_key CHANGE `expire_date` `expire_date` DATE NOT NULL;\nALTER TABLE awa_store_local CHANGE `expire_date` `expire_date` DATE NOT NULL;\n\n/* File generated automatically b...
sql
chosen
[ { "from": "human", "value": "IFS-6162: Update MOs of live projects to see new ACC dashbaord\n" }, { "from": "gpt", "value": "-- IFS-6162: Add live project user role to monitoring officers on already live projects\n\nINSERT INTO user_role (user_id, role_id)\nSELECT pu.user_id, 21\nFROM project_us...
sql
chosen
[ { "from": "human", "value": "Add the initial draft of the BDCS metadata store\n" }, { "from": "gpt", "value": "create table projects (\n id integer primary key,\n name text not null unique,\n summary text not null,\n description text not null,\n homepage text not null,\n upstre...
sql
chosen
[ { "from": "human", "value": "Add values to format and type information in portal admin" }, { "from": "gpt", "value": "# --- !Ups\r\n\r\nINSERT INTO gb.md_format VALUES\r\n\t(11, 'excel'),\r\n\t(12, 'photoshop'),\r\n\t(13, 'powerpoint'),\r\n\t(14, 'word');\r\n\t\r\nINSERT INTO gb.md_format_label ...
sql
chosen
[ { "from": "human", "value": "Allow null values in repo_name so code can be removed\n\nCode that references repo_name can be removed after this migration is\nran so that when the ORM tries to insert, mysql will fill all the values\nwith null since they won't be provided by the code.\n\nSince repo_name is no ...
sql
chosen
[ { "from": "human", "value": "Add Free Beta plan as default\n" }, { "from": "gpt", "value": "-- +goose Up\n-- SQL in section 'Up' is executed when this migration is applied\nINSERT INTO plan VALUES (4, 'Free', 'Free Beta', 0, 10, 1, '2016-10-16 00:00:00', '2016-10-16 00:00:00');\n\n-- +goose Down...
sql
chosen
[ { "from": "human", "value": "Add missing keys to some tables\n\nSummary: I wrote a little query plan plugin for \"Services\", it's not ready yet\nbut it found a few cases where we're doing table scans.\nTest Plan:\nhttps://secure.phabricator.com/file/view/PHID-FILE-374fd7e846a0ce27d5fb/\nhttps://secure.phab...
sql
chosen
[ { "from": "human", "value": "Add ice rocket ping feature.\n" }, { "from": "gpt", "value": "CREATE TABLE `jj`.`hitcount` (\n`resource` VARCHAR( 255 ) NOT NULL ,\n`count` INT NOT NULL DEFAULT '0',\n`updated` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,\nPRIMARY KEY ...
sql
chosen
[ { "from": "human", "value": "Create colors table, referenced from games table\n" }, { "from": "gpt", "value": "CREATE TABLE `colors` (\n `colors_id` int(32) unsigned NOT NULL AUTO_INCREMENT,\n `tag_1` varchar(255) DEFAULT '',\n `tag_2` varchar(255) DEFAULT '',\n `tag_3` varchar(255) DEFAULT ...
sql
chosen
[ { "from": "human", "value": "[ENH] Upgrade schema for spreadsheet toolbar defaults\n\ngit-svn-id: a7fabbc6a7c54ea5c67cbd16bd322330fd10cc35@25497 b456876b-0849-0410-b77d-98878d47e9d5\n" }, { "from": "gpt", "value": "INSERT INTO `tiki_preferences` (`name` ,`value`)\nVALUES ('toolbar_sheet', 'addro...
sql
chosen
[ { "from": "human", "value": "Add SQL function to reset projects that incorrectly have other institution imagery\n" }, { "from": "gpt", "value": "UPDATE projects\nSET imagery_rid = (SELECT select_first_public_imagery())\nWHERE project_uid IN (\n SELECT project_uid\n FROM imagery i\n INNE...
sql
chosen
[ { "from": "human", "value": "KCIRB-1637: Remove link to \"view letter\" from notification text.\n" }, { "from": "gpt", "value": "update NOTIFICATION_TYPE set MESSAGE='The IRB protocol number <a title=\"\" target=\"_self\" href=\"../kew/DocHandler.do?command=displayDocSearchView&amp;docId={DOCUME...
sql
chosen
[ { "from": "human", "value": "Add sql script for Review functionality\n" }, { "from": "gpt", "value": "\n -- Fyi These commands were generated by allowing Hibernate to create the tables locally, and then\n -- running the mysql command 'show create table ...'.\n\n\n CREATE TABLE `VaultReviews` (\n...
sql
chosen
[ { "from": "human", "value": "Include all fitted types in the search index.\n\nOld view was just aggregating fitted modules, now charges and drones\nare included too.\n" }, { "from": "gpt", "value": "CREATE OR REPLACE VIEW loadoutsfittedtypes AS \n SELECT t.fittinghash, \n string_agg(DISTINCT ...
sql
chosen
[ { "from": "human", "value": "Add IF NOT EXISTS to all operations\n" }, { "from": "gpt", "value": "/**\n * Create Posts Table\n */\nCREATE TABLE IF NOT EXISTS posts (\n\tid INTEGER PRIMARY KEY AUTOINCREMENT,\n\ttitle TEXT NOT NULL,\n\tslug TEST NOT NULL,\n\ttext_raw TEXT NOT NULL,\n\ttext_compile...
sql
chosen
[ { "from": "human", "value": "Clean up after previous changes. Remove unnecessary objects.\n" }, { "from": "gpt", "value": "DROP VIEW IF EXISTS dbo.v_f_avop_tilasto\nDROP VIEW IF EXISTS dbo.v_f_tab_avop\n\nDROP TABLE IF EXISTS dbo.f_avop_live\nDROP TABLE IF EXISTS dbo.f_avop_tilasto\n" } ]
sql
chosen
[ { "from": "human", "value": "Add AddressBase Premium Address Point view\n\nSQL View to display AddressBase Premium in the format of Address Point.\nUseful for exporting to CSV\n" }, { "from": "gpt", "value": "-- View: addressbase_premium.address_point\n\n\nCREATE OR REPLACE VIEW addressbase_prem...
sql
chosen
[ { "from": "human", "value": "KCIAC-278: Implement IACUC Request to Deactivate action\n" }, { "from": "gpt", "value": "UPDATE KRCR_PARM_T SET VAL='O' WHERE NMSPC_CD='KC-IACUC' and PARM_NM='IACUC_COMM_SELECTION_DURING_SUBMISSION'\r\n/\r\n" } ]
sql
chosen
[ { "from": "human", "value": "Add new columns to the tables structural_variation and structural_variation_feature\n" }, { "from": "gpt", "value": "# Add new columns to the tables structural_variation and structural_variation_feature.\n\nALTER TABLE structural_variation ADD COLUMN alias VARCHAR(25...
sql
chosen
[ { "from": "human", "value": "DB/Spell: Fix for Hot Streak & Pyroblast\n" }, { "from": "gpt", "value": "-- Fix Mage's \"Pyroblast!\" Istant cast\nDELETE FROM spell_linked_spell WHERE spell_trigger=92315;\nINSERT INTO spell_linked_spell VALUES\n(92315, -48108, 0, \"Pyroblast! & Hot Streak\");" }...
sql
chosen
[ { "from": "system", "value": "Remove the obsolete MA_MEMBER table.\n" }, { "from": "human", "value": "-- avoid innocuous NOTICEs about automatic sequence creation\nset client_min_messages='WARNING';\n\n-- Tables for the MA (Member Authority)\n-- --------------------------------------------------...
sql
chosen
[ { "from": "human", "value": "Change coordinates to float type.\n" }, { "from": "gpt", "value": "IF EXISTS (\n select * from INFORMATION_SCHEMA.COLUMNS\n where TABLE_SCHEMA='dw' and TABLE_NAME='d_organisaatioluokitus'\n and COLUMN_NAME='latitude' and DATA_TYPE='varchar'\n) BEGIN\n ALTER TABL...
sql
chosen
[ { "from": "human", "value": "Fix FK name on table translation_kit_not_found_text_unit_ids\n" }, { "from": "gpt", "value": "alter table translation_kit_not_found_text_unit_ids drop foreign key FK_aw1j6y6fkkgf1tsgqw45o95am;\n\nalter table translation_kit_not_found_text_unit_ids\n\tadd constraint F...
sql
chosen
[ { "from": "human", "value": "Add another Postgres SQL file, stupid Django making time zone aware datetime columns :(\n" }, { "from": "gpt", "value": "ALTER TABLE thing_industryjob ALTER COLUMN install_time TYPE timestamp without time zone;\nALTER TABLE thing_industryjob ALTER COLUMN begin_time T...
sql
chosen
[ { "from": "human", "value": "IFS-5335: Add new version of default Innovate UK terms and conditions\n" }, { "from": "gpt", "value": "-- IFS-5335: Add new version of default Innovate UK terms and conditions\n\nSET @system_maintenance_user_id = (SELECT `id` FROM `user` WHERE `email` = 'ifs_system_m...
sql
chosen
[ { "from": "human", "value": "Add query to extract JSON Film data\n" }, { "from": "gpt", "value": "select row_to_json(r) \n from (\n select 'de.springbootbuch.mongo.Film' as _class,\n title, \n release_year as releaseYear,\n (select array_to_json(array_agg(row_to...
sql
chosen
[ { "from": "human", "value": "Change Active by Montly from materialized table to view with improved query performance\n" }, { "from": "gpt", "value": "create or replace view v_report_active_by_product_term_monthly as\nselect \n cal.d day\n, next_product_name product_name\n, next_billing_period b...
sql
chosen
[ { "from": "human", "value": "Trim \"\\n\" from mimeType field in phabricator_file.file\n\nSummary: See patch comment, which explains the situation.\n\nTest Plan: Ran upgrade, verified mimeType field is \\n-free in database.\n\nReviewers: davidreuss, btrahan\n\nReviewed By: davidreuss\n\nCC: aran, epriestley...
sql
chosen
[ { "from": "human", "value": "Migrate db create total_rewards table\n" }, { "from": "gpt", "value": "\n-- +goose Up\n-- SQL in section 'Up' is executed when this migration is applied\nCREATE TABLE `total_rewards` (\n `id` INT(11) NOT NULL AUTO_INCREMENT,\n `total` INT(11) NOT NULL DEFAULT 0,\n ...
sql
chosen
[ { "from": "human", "value": "Add Postgres version of schema.\n" }, { "from": "gpt", "value": "CREATE TABLE globalimagelinks (\n\tgil_wiki TEXT NOT NULL,\n\tgil_page INTEGER NOT NULL,\n\tgil_page_namespace TEXT NOT NULL,\n\tgil_page_title TEXT NOT NULL,\n\tgil...
sql
chosen
[ { "from": "human", "value": "chore: Set default dean password to admin\n" }, { "from": "gpt", "value": "UPDATE user\nSET password = \"{bcrypt}$2a$10$YUVj9powKqpmcwnAdjCH..3C2qXEoy8elI0XIpxtzRmHz0iobbUbC\"\nWHERE user_id = \"dean\";" } ]
sql
chosen
[ { "from": "human", "value": "Remove links to multicell, multicell will be emulated by the api\n" }, { "from": "gpt", "value": "-- Copyright [1999-2016] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute\n--\n-- Licensed under the Apache License, Version 2.0 (the \"Lic...
sql
chosen
[ { "from": "human", "value": "Patch to permissions for role_member table.\n" }, { "from": "gpt", "value": "\n-- Bleah. Missed another permission.\n\nBEGIN;\nSELECT check_db_revision(1,1,1);\n\nGRANT DELETE ON\n tmp_password\n , role_member\n TO general;\n\nSELECT new_db_revision(1,1,2, 'Feb...
sql
chosen
[ { "from": "human", "value": "VIMS-47: Add migration for inserting the new column references in the vaccine logistics master template. This makes the new columns as configurable as the other existing columns.\n" }, { "from": "gpt", "value": "INSERT INTO vaccine_logistics_master_columns\n(name, de...
sql
chosen
[ { "from": "human", "value": "[mysql] LOAD DATA LOCAL INFILE script\n\nAdd sql script for testing bulk insert\n" }, { "from": "gpt", "value": "DROP TABLE IF EXISTS USER;\nCREATE TABLE USER (\n ID CHAR(32) PRIMARY KEY,\n NAME VARCHAR(16),\n MONEY DEC(10),\n LAST DATETIME\n );\n \nLOAD DATA L...
sql
chosen
[ { "from": "human", "value": "Add 'invited-by' field to database\n" }, { "from": "gpt", "value": "BEGIN TRANSACTION;\n\n-- Ensure there really are listeners\n\nALTER TABLE subscriptions ADD COLUMN \"invited_by\" TEXT;\n\nINSERT INTO schema_version (version, \"when\", description)\n VALUES (...
sql
chosen
[ { "from": "human", "value": "webadmin: Remove irrelevant operations from UserVmManager role\n\nOperations ActionGroup.MOVE_VM, ActionGroup.MIGRATE_VM are detached from UserVMManager role\n\nChange-Id: I4e85bf9adce32e6f60cec02a036d8c7798aba8a0\nBug-Url: https://bugzilla.redhat.com/885132\nSigned-off-by: Libo...
sql
chosen
[ { "from": "human", "value": "KCIAC-71: Update maintenance tables for IACUC protocol types\n" }, { "from": "gpt", "value": "UPDATE IACUC_PROTOCOL_TYPE SET PROTOCOL_TYPE_CODE=444 WHERE DESCRIPTION='Teaching'\n/\nUPDATE IACUC_PROTOCOL_TYPE SET PROTOCOL_TYPE_CODE=5 WHERE DESCRIPTION='Testing'\n/\nUP...
sql
chosen
[ { "from": "human", "value": "Add sample SQL template to create PostgreSQL VIEW for iRedMail server.\n" }, { "from": "gpt", "value": "--\n-- Notes:\n--\n-- * if you're running RHEL/CentOS 6 or 7, don't forget to uncomment lines\n-- under `Required by RHEL/CentOS X` to create dblink function.\n-...
sql
chosen
[ { "from": "human", "value": "Add a small workload for testing BIP.\n" }, { "from": "gpt", "value": "-- query\nselect\n\tp_brand,\n\tp_size,\n\tp_type,\n\tp_name, \n\tps_supplycost\nfrom\n\ttpch.partsupp,\n\ttpch.part\nwhere\n\tp_brand <> 'Brand#41'\n\tand p_type not like 'MEDIUM BURNISHED%'\n\ta...
sql
chosen
[ { "from": "human", "value": "Fix overlapping mailbox in undercity (Trade Quarter, south)\n" }, { "from": "gpt", "value": "INSERT INTO version_db_world (`sql_rev`) VALUES ('1525439768213092888');\n\nDELETE FROM `gameobject` WHERE `id` = 195629;\n" } ]
sql
chosen
[ { "from": "human", "value": "Add sql script to clear neighborhoods\n" }, { "from": "gpt", "value": "-- Clears all entries in the portal_neighborhood table\n-- Corresponds to Neighborhood model\nBEGIN;\nUPDATE portal_location \n SET neighborhood_id = NULL;\nDELETE FROM portal_neighborhood;\nCOMM...
sql
chosen
[ { "from": "human", "value": "Update layers for hki stats\n" }, { "from": "gpt", "value": "-- update layer name\nUPDATE oskari_maplayer SET srs_name='EPSG:3879' where type = 'statslayer' and name = 'seutukartta:Seutu_suuralueet';\nUPDATE oskari_maplayer SET srs_name='EPSG:3879' where type = 'stat...
sql
chosen
[ { "from": "human", "value": "KCIAC-224: Implement View Restricted Notes permission for IACUC protocols\n" }, { "from": "gpt", "value": "INSERT INTO KRIM_PERM_T (PERM_ID, OBJ_ID, VER_NBR, PERM_TMPL_ID, NMSPC_CD, NM, DESC_TXT, ACTV_IND)\r\n VALUES (KRIM_PERM_ID_BS_S.NEXTVAL, SYS_GUID(), 1, (SEL...
sql
chosen
[ { "from": "human", "value": "KCIAC-277: Implement notification for IACUC action Deactivate\n" }, { "from": "gpt", "value": "INSERT INTO NOTIFICATION_TYPE (NOTIFICATION_TYPE_ID, MODULE_CODE, ACTION_CODE, DESCRIPTION, SUBJECT, MESSAGE, PROMPT_USER, SEND_NOTIFICATION, UPDATE_USER, UPDATE_TIMESTAMP,...
sql
chosen
[ { "from": "human", "value": "KCIAC-28: Implement IACUC notification for Admin Withdraw\n" }, { "from": "gpt", "value": "INSERT INTO NOTIFICATION_TYPE (NOTIFICATION_TYPE_ID, MODULE_CODE, ACTION_CODE, DESCRIPTION, SUBJECT, MESSAGE, PROMPT_USER, SEND_NOTIFICATION, UPDATE_USER, UPDATE_TIMESTAMP, VER...
sql
chosen
[ { "from": "human", "value": "Add millis to datetime fields in DB\n" }, { "from": "gpt", "value": "ALTER TABLE SECURE_DATA\n CHANGE CREATED_TS CREATED_TS DATETIME(3) NOT NULL,\n CHANGE LAST_UPDATED_TS LAST_UPDATED_TS DATETIME(3) NOT NULL;\n\nALTER TABLE SECURE_DATA_VERSION\n CHANGE ACTION_TS A...
sql
chosen
[ { "from": "human", "value": "Add occurrence date range columns to model runs db table\n" }, { "from": "gpt", "value": "-- Updates the database schema to add occurrence_data_range_start_date and occurrence_data_range_end_date columns to the model_run table.\n-- Copyright (c) 2015 University of Ox...
sql
chosen
[ { "from": "human", "value": "IFS-5266: Move notified column over to eu_grant table\n" }, { "from": "gpt", "value": "-- IFS-5266 Refactor notified flag to hang off eu_grant rather than eu_contact\n\nALTER TABLE `eu_contact`\nDROP COLUMN `notified`;\n\nALTER TABLE `eu_grant`\nADD COLUMN `notified`...
sql
chosen
[ { "from": "human", "value": "Update Tilastokeskus config for 2020" }, { "from": "gpt", "value": "UPDATE oskari_statistical_datasource SET config='{\n\t\"url\": \"https://pxnet2.stat.fi/pxweb/api/v1/{language}/Kuntien_avainluvut/2020/kuntien_avainluvut_2020_aikasarja.px\",\n\t\"info\": {\n\t\t\"u...
sql
chosen
[ { "from": "human", "value": "VIMS-523: Add migration script add missing columns on AEFI line items and cold chain line items tables.\n" }, { "from": "gpt", "value": "ALTER TABLE vaccine_report_cold_chain_line_items\nADD operationalStatusId INTEGER NULL references equipment_operational_status(id)...
sql
chosen
[ { "from": "human", "value": "Update proper path for findbycoordinates in ol4 view\n" }, { "from": "gpt", "value": "-- update ol4 version for development appsetup\nUPDATE portti_view_bundle_seq SET startup = '{\n \"bundlename\" : \"findbycoordinates\",\n \"metadata\" : {\n \"Import-B...
sql
chosen
[ { "from": "human", "value": "Create a separate master and program configuration tables for IVD form visibility configurations.\n" }, { "from": "gpt", "value": "CREATE TABLE vaccine_ivd_tabs(\n tab VARCHAR(200) UNIQUE PRIMARY KEY NOT NULL,\n name VARCHAR(200) NOT NULL,\n\n ...
sql
chosen
[ { "from": "human", "value": "Update parse_log tables messages fk cascade type\n\nAdd ON DELETE CASCADE, in order to be able to delete agent smoothly\n" }, { "from": "gpt", "value": "SET search_path TO rasa_ui;\n\n-- Add On delete CASCADE when a message is deleted from the messages table\n\nALTER...
sql
chosen
[ { "from": "human", "value": "Delete obsolete Thunderbird & Seamonkey categories\n\nOtherwise they can show up in devhub & API even though they are no longer useful\nas we moved thunderbird & seamonkey add-ons to a different site.\n" }, { "from": "gpt", "value": "-- Remove categories for applicat...
sql
chosen
[ { "from": "human", "value": "Add a database migration (create index), so that matching on indirectlyIdentifiedBy does not require seq scans.\n" }, { "from": "gpt", "value": "BEGIN;\n\nDO $$DECLARE\n -- THESE MUST BE CHANGED WHEN YOU COPY THE SCRIPT!\n \n -- The version you expect the datab...
sql
chosen
[ { "from": "human", "value": "Add ProjectLicense SQL insert script" }, { "from": "gpt", "value": "BEGIN;\n\nINSERT INTO projectlicense VALUES(1, 'f', 'f', 'f', 't', 'GNU General Public License 2.0', 0, 'GPL-2.0', 'http://opensource.org/licenses/GPL-2.0');\nINSERT INTO projectlicense VALUES(2, 'f'...
sql
chosen
[ { "from": "human", "value": "[FIND-969] Add the H2 migration script\n\n[rev: ivo.miller]\n" }, { "from": "gpt", "value": "/*-------------------------------------------\n-- Description: Add username column to\n Users table.\n\n-- Previous Version: 11.4.0.0\n-- Target Version: 11.4.0.1\n-------...
sql
chosen
[ { "from": "human", "value": "Add select query for selecting class for lecturer\n" }, { "from": "gpt", "value": "SELECT Class.id AS id, \nClass.module_id AS moduleId, \nModule.name AS moduldeName \nFROM Class \nINNER JOIN Module ON Module.id = Class.module_id \nINNER JOIN Semester ON Semester.id ...
sql
chosen
[ { "from": "human", "value": "Add more complex DB records\n" }, { "from": "gpt", "value": "ALTER TABLE category\n\tADD UNIQUE (name);\nALTER TABLE film\n\tADD UNIQUE (title);\nINSERT INTO film (film_id, title, description, language_id, length, release_year) VALUES\n\t(-1, 'Die Welle', 'A high sch...
sql
chosen
[ { "from": "human", "value": "Hide Skipped products feature setting\n" }, { "from": "gpt", "value": "delete from configuration_settings where key = 'RNR_HIDE_SKIPPED_PRODUCTS';\n\nINSERT INTO configuration_settings (key, name, groupname, description, value, valueType,displayOrder)\n values ('RNR...
sql
chosen
[ { "from": "human", "value": "Remove scale limits from user generated content\n" }, { "from": "gpt", "value": "UPDATE oskari_maplayer\n SET minscale=-1, maxscale=-1\nwhere\n internal = true\n and name in ('oskari:my_places', 'oskari:vuser_layer_data', 'oskari:analysis_data');\n" } ]
sql
chosen
[ { "from": "human", "value": "Increase the cost of shields/armour from 150/75 to 250/150\n\nThis change is made to help balance certain combat dynamics.\n\n* Reduces the profits from port raiding (which were too high).\n\n* Makes clearing forces slightly more expensive, since there was\n a large imbalance b...
sql
chosen
[ { "from": "human", "value": "Add account_type column / Remove unique_email constraint and add a new (email, account_type) constraint\n" }, { "from": "gpt", "value": "-- Copyright 2020 MSolution.IO\n--\n-- Licensed under the Apache License, Version 2.0 (the \"License\");\n-- you may not use...
sql
chosen
[ { "from": "human", "value": "Change database-columns to double to be more accurate\n" }, { "from": "gpt", "value": "ALTER TABLE `kwc_basic_image` CHANGE `crop_x` `crop_x` DOUBLE NOT NULL;\nALTER TABLE `kwc_basic_image` CHANGE `crop_y` `crop_y` DOUBLE NOT NULL;\nALTER TABLE `kwc_basic_image` CHAN...
sql
chosen
[ { "from": "human", "value": "Add My Schema for ref\n" }, { "from": "gpt", "value": "SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;\nSET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;\nSET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';\n\nCREA...
sql
chosen
[ { "from": "human", "value": "Add SQL for the API write tests\n\nThis can then be used by the vagrant provisioning scripts to seed the\ndevelopment environment.\n" }, { "from": "gpt", "value": "-- SQL for API write tests\n--\n-- These aren't safe to run on a live platform, but are very valuable i...
sql
chosen
[ { "from": "human", "value": "Add base SQL file. PostgreSQL?\n" }, { "from": "gpt", "value": "DROP TABLE if EXISTS user;\nCREATE TABLE user (\n user_id integer PRIMARY KEY autoincrement,\n username string NOT NULL,\n email string NOT NULL,\n pw_hash string NOT NULL\n);\n\nDROP TABLE if EXIST...
sql
chosen
[ { "from": "human", "value": "KRACOEUS-5597: Create parameter to display list of special review items for Approver View\n" }, { "from": "gpt", "value": "INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_CD, VAL, PARM_DESC_TXT, EVAL_OPRTR_CD, APPL_ID)\r\nVALUES ('KC-P...
sql
chosen