conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Fix SQL Server trigger creation error\n"
},
{
"from": "human",
"value": "IF NOT EXISTS (SELECT * FROM sys.tables WHERE name = N'users' AND type = 'U')\nBEGIN\nCREATE TABLE dbo.users\n (id int PRIMARY KEY IDENTITY(1,1) NOT NULL,\n username varchar(45) NULL,\n ... | sql | chosen |
[
{
"from": "system",
"value": "Add primary key changes to 0001 db migration\n\nAlso reformat the SQL and switch to varchar(32).\n"
},
{
"from": "human",
"value": "alter table mob add owner varchar(80);\nalter table mob_imm add owner varchar(80);\nalter table mob_extra add owner varchar(80);\nalte... | sql | chosen |
[
{
"from": "system",
"value": "Add role to Users table\n"
},
{
"from": "human",
"value": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\... | sql | chosen |
[
{
"from": "system",
"value": "Drop unused columns from the taxon table\n"
},
{
"from": "human",
"value": "## start naming files to reference the release version and git tag at which point the code will require the changes in this file\n\nupdate CHROMOSOME_FEATURE set class = \"GeneProduct\" wher... | sql | chosen |
[
{
"from": "system",
"value": "Fix update to work with mysqldump restore data\n"
},
{
"from": "human",
"value": "ALTER TABLE addays MODIFY COLUMN Day enum('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat') NOT NULL;\n"
},
{
"from": "gpt",
"value": "ALTER TABLE addays MODIFY COLUMN Day e... | sql | chosen |
[
{
"from": "system",
"value": "Fix create schema sql script\n"
},
{
"from": "human",
"value": "CREATE DATABASE `powerauth`;\n\nCREATE USER 'powerauth'@'localhost';\n\nGRANT ALL PRIVILEGES ON powerauth.* TO 'powerauth'@'localhost';\n\nFLUSH PRIVILEGES;\n"
},
{
"from": "gpt",
"value": "... | sql | chosen |
[
{
"from": "system",
"value": "Fix langtag on update without extra double-quotes\n\nSigned-off-by: Joern Bernhardt <7b85a41a628204b76aba4326273a3ccc74bd009a@campudus.com>\n"
},
{
"from": "human",
"value": "CREATE OR REPLACE FUNCTION create_ordering_for_link_table(link_table REGCLASS)\n RETURNS T... | sql | chosen |
[
{
"from": "system",
"value": "Fix migration 854 (some collections had subscribers...)\n"
},
{
"from": "human",
"value": "DROP TABLE IF EXISTS `addon_recommendations`;\nDELETE FROM collections WHERE collection_type IN (1, 3); -- COLLECTION_SYNCHRONIZED or COLLECTION_RECOMMENDED\nDELETE FROM waffl... | sql | chosen |
[
{
"from": "system",
"value": "Update MySQL init to allow APM user to be on any IP\n"
},
{
"from": "human",
"value": "--\n-- Add demo user\n--\n\nCREATE USER 'demo'@'localhost' IDENTIFIED BY 'welcome1';\nGRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, EXECUTE ON *.* TO 'demo'@'localhost';\nCRE... | sql | chosen |
[
{
"from": "system",
"value": "Fix syntax error in migration 820.\n"
},
{
"from": "human",
"value": "-- Update any old file upload entries which have errors to\n-- include a skeleton system error validator report.\nUPDATE\n `file_uploads`\nSET\n `validation` = '{\"errors\": 1, \"success\": ... | sql | chosen |
[
{
"from": "system",
"value": "Add multi in place of workers in latest set report.\n"
},
{
"from": "human",
"value": "WITH lastset AS (\nSELECT max(set) as lastset from tests\n)\n\n\nSELECT\n set,script,scale,test,clients,workers,\n rate_limit AS limit,\n client_limit AS client_limit,\n round... | sql | chosen |
[
{
"from": "system",
"value": "Fix can challenge for performance query\n"
},
{
"from": "human",
"value": "SELECT * FROM users WHERE\n(NOT EXISTS (SELECT * FROM challenges WHERE userNamenumber = $1 AND performanceid = $2)) AND\n(SELECT voluntary FROM manage AS m WHERE m.usernamenumber = $1 AND m.p... | sql | chosen |
[
{
"from": "system",
"value": "Add the script to create db with proper encoding\n"
},
{
"from": "human",
"value": "CREATE TABLE \"public\".\"media\" (\n \"id\" serial NOT NULL,\n \"iid\" text NOT NULL,\n \"document\" jsonb NOT NULL,\n \"created_at\" timestamp NOT NULL,\n PRIMARY KE... | sql | chosen |
[
{
"from": "system",
"value": "Switch default log_parts.created_at data type\n"
},
{
"from": "human",
"value": "-- Deploy travis-logs:log_parts_created_at_not_null to pg\n-- requires: structure\n\nBEGIN;\n\n SET client_min_messages = WARNING;\n\n ALTER TABLE log_parts\n ALTER COLUMN created_at... | sql | chosen |
[
{
"from": "system",
"value": "SQL: Test the simple MPU query\n"
},
{
"from": "human",
"value": "--drop proc sspBatchMPU -- Monthly Paying User\ncreate proc sspBatchMPU\nas\nset nocount on\ndeclare @Day30DT datetimeoffset(7)\ndeclare @CurrentDT datetimeoffset(7)\ndeclare @nowdt datetime\ndeclare... | sql | chosen |
[
{
"from": "system",
"value": "Add the post deployment script\n"
},
{
"from": "human",
"value": "/*\nPost-Deployment Script Template \n--------------------------------------------------------------------------------------\n This file contains SQL statements that will be appended to ... | sql | chosen |
[
{
"from": "system",
"value": "Update SQL DDL to match renamed table\n"
},
{
"from": "human",
"value": "DROP TABLE IF EXISTS wf_access_contexts;\n\n--\n\nCREATE TABLE wf_access_contexts (\n id INT NOT NULL AUTO_INCREMENT,\n ns_id INT NOT NULL,\n group_id INT NOT NULL,\n role_id INT NO... | sql | chosen |
[
{
"from": "system",
"value": "Adjust a comment line that prevents cloud from deploying\n"
},
{
"from": "human",
"value": "--\n-- PostgreSQL database dump\n--\n\n\nCREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;\n\n\n\nCOMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';... | sql | chosen |
[
{
"from": "system",
"value": "[afu_onlinerisk_transfer] Fix 2 für Konsultationsabstand in Untersuchungseinheit\n"
},
{
"from": "human",
"value": "SELECT\n ue.id_untersuchungseinheit AS t_id,\n 'Point(' || ue.koordinate_x::text || ' ' || ue.koordinate_y::text || ')' AS geometrie,\n k.... | sql | chosen |
[
{
"from": "system",
"value": "Fix typo so that function has the same name in all clients\n"
},
{
"from": "human",
"value": "CREATE TABLE users(\n id SERIAL PRIMARY KEY,\n username TEXT NOT NULL,\n email TEXT NOT NULL,\n password TEXT NOT NULL\n);... | sql | chosen |
[
{
"from": "system",
"value": "Make this patch less mysql-dependent. Needs testing with PostgreSQL.\n"
},
{
"from": "human",
"value": " -- create a new, hive-specific table for meta data and start using it for hive_sql_schema_version tracking:\n\nCREATE TABLE hive_meta (\n meta_key ... | sql | chosen |
[
{
"from": "system",
"value": "Add a new test table\n"
},
{
"from": "human",
"value": "-- psql --username=testuser test\n\nCREATE TABLE artist (\n name text NOT NULL,\n year int NOT NULL\n);\n"
},
{
"from": "gpt",
"value": "-- psql --username=testuser test\n\nCREATE TABLE artist... | sql | chosen |
[
{
"from": "system",
"value": "Fix typo in seed data\n"
},
{
"from": "human",
"value": "INSERT INTO\n albums (title, artist)\nVALUES\n ('Malibu', 'Anderson .Paak'),\n ('A Seat at the Table', 'Solange Knowles'),\n ('Melodrama', 'Lorde'),\n ('In Rainbows', 'Radiohead')\n;\n\nINSERT INTO\n use... | sql | chosen |
[
{
"from": "system",
"value": "Add default attribute to Test Hospital domain."
},
{
"from": "human",
"value": "CREATE TABLE CWF_DOMAIN (\n\tID VARCHAR(20) PRIMARY KEY,\n\tNAME VARCHAR(255),\n\tATTRIBUTES VARCHAR(255) DEFAULT '');\n\nINSERT INTO CWF_DOMAIN (ID, NAME, ATTRIBUTES) VALUES\n\t('1', 'G... | sql | chosen |
[
{
"from": "system",
"value": "Update migration to add igg"
},
{
"from": "human",
"value": "create table sguser (\n id serial not null primary key,\n email text not null unique,\n password text not null,\n username text,\n credentials text,\n challenges text,\n emailverified boolean,\n ve... | sql | chosen |
[
{
"from": "system",
"value": "Fix usr_db V 46 migration script for SQL Server... third time lucky?\n"
},
{
"from": "human",
"value": "SET XACT_ABORT ON;\nBEGIN TRANSACTION;\n -- update the version\n UPDATE usr_schema_version SET version_value='46' WHERE version_key='schema_patch';\n\n DROP IN... | sql | chosen |
[
{
"from": "system",
"value": "Fix SQL migration script to work on proxy\n\nNot sure why this didn't fail in tests, but it did during deployment (applying migrations) on production environments."
},
{
"from": "human",
"value": "DROP TRIGGER blobs_blobmeta_trigger ON blobs_blobmeta;\nDROP FUNCTION... | sql | chosen |
[
{
"from": "system",
"value": "Add index on thrads createtime\n"
},
{
"from": "human",
"value": "UPDATE users SET updateTime = createtime where updatetime is null;\nUPDATE items SET updateTime = createtime where updatetime is null\nUPDATE rels SET updateTime = createtime where updatetime is null\... | sql | chosen |
[
{
"from": "system",
"value": "Drop module and no array\n"
},
{
"from": "human",
"value": "-- Module for all code for the logger utility.\nCREATE OR REPLACE MODULE LOGGER;\n\n-- Public functions and procedures.\n-- Procedure to write logs.\nALTER MODULE LOGGER PUBLISH\n PROCEDURE LOG (\n IN LOGG... | sql | chosen |
[
{
"from": "system",
"value": "Update to stored procedure for getting paye scheme information for an account to not make it get scheme information for schemes that have been removed\n"
},
{
"from": "human",
"value": "CREATE PROCEDURE [account].[GetPayeSchemes_ByAccountId]\n\t@accountId BIGINT\nA... | sql | chosen |
[
{
"from": "system",
"value": "Fix the creation of the table sc_delegatednews_news for Oracle: the declaration of the column newsOrder was incorrect\n"
},
{
"from": "human",
"value": " create table sc_delegatednews_news (\n pubId\t\tint\t\tnot null,\n instanceId\t\tvarchar(50) no... | sql | chosen |
[
{
"from": "system",
"value": "Drop database table when running init_b\n"
},
{
"from": "human",
"value": "CREATE TABLE measurements (\n id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,\n time_stamp DATETIME,\n stroom_dal FLOAT,\n stroom_piek FLOAT,\n stroom_current FLOAT,\n gas FLOAT,\n\n diff_... | sql | chosen |
[
{
"from": "system",
"value": "Add comment to trigger definition\n"
},
{
"from": "human",
"value": "CREATE TRIGGER logidze_on_<%= table_name %>\nBEFORE UPDATE OR INSERT ON <%= table_name %> FOR EACH ROW\nWHEN (coalesce(current_setting('logidze.disabled', true), '') <> 'on')\nEXECUTE PROCEDURE log... | sql | chosen |
[
{
"from": "system",
"value": "Fix filter\nHad `is null` instead of `is not null`, so it was returning only internal workspaces\n"
},
{
"from": "human",
"value": "set echo off\nset verify off\nset feedback off\nset heading off\nset trimspool on\nset termout off\nset pagesize 0\n\nspool &1\n\nsele... | sql | chosen |
[
{
"from": "system",
"value": "Set drinkIngredients and additionaldDrinkNames to cascade delete\n"
},
{
"from": "human",
"value": "BEGIN;\n CREATE TABLE users (\n id serial NOT NULL PRIMARY KEY,\n username text NOT NULL UNIQUE,\n passwordHash text NOT NULL,\n salt text NOT NULL,\n ... | sql | chosen |
[
{
"from": "system",
"value": "Correct subset names for US/GB English\n"
},
{
"from": "human",
"value": "-- Original SubsetIds are not known in RF2, so we need to populate those\nINSERT INTO RF2_subset2refset (originalSubsetId, SubsetName, RefsetId, fsn, location) \nvalues (100032, 'GB English La... | sql | chosen |
[
{
"from": "system",
"value": "Fix typo in schema creation script\n\nSigned-off-by: Carter Landis <84a516841ba77a5b4648de2cd0dfcb30ea46dbb4@carterlandis.com>\n"
},
{
"from": "human",
"value": "-- Generate core schema\n\\i schema/generate/01-schema.sql\n\\i schema/generate/02-augur_data.sql\n\\i s... | sql | chosen |
[
{
"from": "system",
"value": "Add boolean field 'accounted' to payments\n"
},
{
"from": "human",
"value": "CREATE DATABASE debtmanager OWNER debtmanager;\nUSE debtmanager;\n\nCREATE SCHEMA debtmanager;\nSET search_path TO debtmanager;\n\nCREATE TABLE users (\n id serial PRIMARY KEY,... | sql | chosen |
[
{
"from": "system",
"value": "Update dates were lost for all statuses on database upgrade\n"
},
{
"from": "human",
"value": "-- Allow to record the whole history of statuses, not only the last one\nALTER TABLE `status` DROP INDEX `unique_status`;\nALTER TABLE `status` ADD `isLatest` BOOLEAN ... | sql | chosen |
[
{
"from": "system",
"value": "Test batching of events\nRunning this script shows grouping of events of 10 /step\nusing the sensor setting:\nsensor --host=localhost --port=50500 --events=100 --columns=3 --delay=1\n"
},
{
"from": "human",
"value": "-- Scenario to exercise the datacell implementati... | sql | chosen |
[
{
"from": "system",
"value": "Fix order of table delete for uninstall\n"
},
{
"from": "human",
"value": "DROP TABLE IF EXISTS `civicrm_sms_conversation_contact`;\nDROP TABLE IF EXISTS `civicrm_sms_conversation_action`;\nDROP TABLE IF EXISTS `civicrm_sms_conversation_question`;\nDROP TABLE IF EXI... | sql | chosen |
[
{
"from": "system",
"value": "Change lysr_feed url type from DATALINK to TEXT\n"
},
{
"from": "human",
"value": "CREATE TABLE lysr_user (\n\tid BIGSERIAL PRIMARY KEY,\n\temail VARCHAR(255) UNIQUE,\n\tpassword VARCHAR(60)\n);\n\nCREATE TABLE lysr_user_settings (\n\tid BIGSERIAL PRIMARY KEY,\n\tus... | sql | chosen |
[
{
"from": "system",
"value": "Use timestamp instead of date\n"
},
{
"from": "human",
"value": "CREATE TABLE IF NOT EXISTS cd_profiles\n(\n id character varying,\n name character varying,\n user_id character varying,\n alias character varying,\n dob date,\n \"country\" json,\n city json,\n... | sql | chosen |
[
{
"from": "system",
"value": "Use 'IF EXISTS' on db creation. This way it won't fail even when same migration is ran multiple times.\n"
},
{
"from": "human",
"value": "create type STATUS as enum ('WAITING', 'REVIEWED', 'ACCEPTED');\ncreate table peer_reviews (\n task_id text not null,\n commen... | sql | chosen |
[
{
"from": "system",
"value": "Add LOGIN permissions to new roles\n\nThese were missing from the initial commit which causes metacpan and\nmetacpan-api to be unable to log into the database. These statements\ncould have been `CREATE USER` statements and would have avoided the need\nfor `WITH LOGIN`, but the ... | sql | chosen |
[
{
"from": "system",
"value": "[DB] Add IGNORE to a perms schema that causes an error each time it's run (for some reason).\n\ngit-svn-id: 9bac41f8ebc9458fc3e28d41abfab39641e8bd1c@30590 b456876b-0849-0410-b77d-98878d47e9d5\n"
},
{
"from": "human",
"value": "INSERT INTO `users_permissions` (`permN... | sql | chosen |
[
{
"from": "system",
"value": "Use TEXT type instead of CLOB as it's compatible with postgres.\n\nThis results in the same underlying h2 type.\n"
},
{
"from": "human",
"value": "--\n-- Copyright 2018 ThoughtWorks, Inc.\n--\n-- Licensed under the Apache License, Version 2.0 (the \"License\");\n-- ... | sql | chosen |
[
{
"from": "system",
"value": "Fix migration 942: file_uploads can have a FK to the rows we're deleting\n"
},
{
"from": "human",
"value": "DELETE FROM `applications_versions` WHERE application_id = 60;\nDELETE FROM `appversions` WHERE application_id = 60;\nDELETE FROM `appsupport` WHERE app_id = ... | sql | chosen |
[
{
"from": "system",
"value": "Fix for upgrade issue from 0.7.4 to 0.8.0\n\nThis fixes the following problem found during testing:\n```\nALTER EXTENSION cartodb UPDATE TO '0.8.0';\nERROR: cannot change return type of existing function\nHINT: Use DROP FUNCTION cdb_usertables(text) first.\n```\n"
},
{
... | sql | chosen |
[
{
"from": "system",
"value": "Remove delete from table that does not exist\n"
},
{
"from": "human",
"value": "CREATE PROCEDURE [employer_account].[Cleardown]\n\t@INCLUDEUSERTABLE TINYINT = 0\nAS\n\tDELETE FROM [employer_account].[AccountEmployerAgreement];\n\tDELETE FROM [employer_account].[Emp... | sql | chosen |
[
{
"from": "system",
"value": "Add more multicolumn sample lines\n"
},
{
"from": "human",
"value": "-- Example like joins.sql but joining on multiple columns.\ndrop table if exists t1;\ndrop table if exists t2;\n\ncreate table t1 (\n id int primary key,\n name text,\n ranking int);\n\ncr... | sql | chosen |
[
{
"from": "system",
"value": "Add check for source module ids that are inactive\n"
},
{
"from": "human",
"value": "\n/********************************************************************************\n\tfile-centric-snapshot-mdrs-referenced-module-inactive.sql\n\n\tAssertion:\n\tReferenced module... | sql | chosen |
[
{
"from": "system",
"value": "Fix SQL Server 2008 ALTER TABLE syntax (ADD COLUMN -> ADD) in usr_db migration script\n"
},
{
"from": "human",
"value": "SET XACT_ABORT ON;\nBEGIN TRANSACTION;\n -- update the version\n UPDATE usr_schema_version SET version_value='46' WHERE version_key='schema_pat... | sql | chosen |
[
{
"from": "system",
"value": "CLOUDSTACK-8300: Set indexes on event table\n"
},
{
"from": "human",
"value": "-- Licensed to the Apache Software Foundation (ASF) under one\n-- or more contributor license agreements. See the NOTICE file\n-- distributed with this work for additional information\n-... | sql | chosen |
[
{
"from": "system",
"value": "Update SQL with WITH statement\n"
},
{
"from": "human",
"value": "-- Aggregate bird_migration_altitude_profile data:\n-- - Aggregate on time frame (e.g. 20 min)\n-- - Aggregate on altitude band (e.g. 200-1600m, 1600+ m)\n-- - Average values\n\nSELECT\n radar_id,\n ... | sql | chosen |
[
{
"from": "system",
"value": "Update SQL for customer class\n"
},
{
"from": "human",
"value": "CREATE Class customer\nCREATE PROPERTY customer.customer_id INTEGER\nCREATE PROPERTY customer.company_name STRING\n\nCREATE Class contacts\nCREATE PROPERTY contacts.contacts_id INTEGER\nCREATE PROPERTY... | sql | chosen |
[
{
"from": "system",
"value": "Add seed data for new column\n"
},
{
"from": "human",
"value": "/*\n Pre-Deployment Script Template\t\t\t\t\t\t\t\n--------------------------------------------------------------------------------------\n This file contains SQL statements that will be executed befor... | sql | chosen |
[
{
"from": "system",
"value": "Remove schema name from sql. Flyway knows which schema to update and on different machines we use different schemas\n"
},
{
"from": "human",
"value": "CREATE TABLE smr_new.player_has_mission\n(\n\tgame_id INT UNSIGNED NOT NULL,\n\taccount_id INT UNSIGNED NOT NULL,\n... | sql | chosen |
[
{
"from": "system",
"value": "Make fqdnSets index across setHash and issued\n"
},
{
"from": "human",
"value": "\n-- +goose Up\n-- SQL in section 'Up' is executed when this migration is applied\n\nCREATE TABLE `fqdnSets` (\n `id` INT(11) NOT NULL AUTO_INCREMENT,\n -- SHA256 hash of al... | sql | chosen |
[
{
"from": "system",
"value": "[euro] Update SQL script for reset\n"
},
{
"from": "human",
"value": "update lfv2_account set cup_cagnoute = false, cup_points = 0, cup_rank = 99;\ndelete from lfv2_cup_vote;\ndelete from lfv2_cup_match;\nupdate lfv2_cup set name = 'EURO 2016';"
},
{
"from":... | sql | chosen |
[
{
"from": "system",
"value": "Remove useless key country from radios since we have city\n"
},
{
"from": "human",
"value": "CREATE TABLE genre( id INTEGER PRIMARY KEY AUTOINCREMENT,\n name TEXT UNIQUE );\n\nCREATE TABLE stream_url( id INTEGER PRIMARY KEY AUTOINCREMENT,\n ... | sql | chosen |
[
{
"from": "system",
"value": "Support renaming users for roles.\n"
},
{
"from": "human",
"value": "begin;\nalter table journals drop constraint \"$1\";\nalter table journals add foreign key (submitted_by) references users (name) on update cascade;\nend;\n"
},
{
"from": "gpt",
"value"... | sql | chosen |
[
{
"from": "system",
"value": "Fix non-reentrant metadata am: e6b3c2f713\nam: 3a05525f32\n\nChange-Id: If62f55380a9393e7c9065d0b316cef3cd19f1fed\n"
},
{
"from": "human",
"value": "--\n-- Copyright 2019 The Android Open Source Project\n--\n-- Licensed under the Apache License, Version 2.0 (the \"L... | sql | chosen |
[
{
"from": "system",
"value": "Fix insertion query error in example app\n"
},
{
"from": "human",
"value": "create table skinny_sessions (\n id bigserial not null primary key,\n created_at timestamp not null,\n expire_at timestamp not null\n);\n\ncreate table servlet_sessions (\n jsession_id v... | sql | chosen |
[
{
"from": "system",
"value": "Add modified_at and photo fields to user table.\n"
},
{
"from": "human",
"value": "CREATE TABLE IF NOT EXISTS users (\n id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),\n created_at timestamptz DEFAULT current_timestamp,\n username text,\n email text,\n password... | sql | chosen |
[
{
"from": "system",
"value": "Add taxon + media to SQL\n"
},
{
"from": "human",
"value": "ALTER TABLE gbif_dataset_metrics\nADD COLUMN dataset_key text,\nADD COLUMN occurrences integer,\nADD COLUMN bor_preserved_specimen integer,\nADD COLUMN bor_fossil_specimen integer,\nADD COLUMN bor_living_sp... | sql | chosen |
[
{
"from": "system",
"value": "Add a failsafe to make sure the next release does not run into trouble.\n"
},
{
"from": "human",
"value": "BEGIN;\n\nDO $$DECLARE\n -- THESE MUST BE CHANGED WHEN YOU COPY THE SCRIPT!\n \n -- The version you expect the database to have _before_ the migration\n ... | sql | chosen |
[
{
"from": "system",
"value": "Fix fixtures to avoid error (mysql safe mode)\n"
},
{
"from": "human",
"value": "DROP TABLE book;\nDROP VIEW view_book_titles;\n\nCREATE TABLE book\n(\n id INTEGER NOT NULL AUTO_INCREMENT COMMENT 'Book Id',\n title VARCHAR(255) NOT NULL COMMENT 'Book Title',\n... | sql | chosen |
[
{
"from": "system",
"value": "Set echo on and feedback on to see what's going on\n"
},
{
"from": "human",
"value": "PROMPT Run user examples\nset echo off\nset feedback off\nset linesize 1000\n\nprompt Common examples from web\n\nexec ut_ansiconsole_helper.color_enabled(true);\n@@award_bonus/run... | sql | chosen |
[
{
"from": "system",
"value": "Correct script adding missing columns and correcting node key\n"
},
{
"from": "human",
"value": "-- Target versions: pre v2.2.0\n-- MUST be executed when upgrading to SlipStream v2.2.0 and BEFORE restarting SlipStream server\n\n-- Migrating MAPKEY and MODULE_RESOURC... | sql | chosen |
[
{
"from": "system",
"value": "Allow regular PostgreSQL user to create objects in its own schema\n\nThe \"setup.sql\" script that runs several bootstrap commands for a\nPostgreSQL database that is deployed by the Operator includes adding\na user schema (a standard part of the search patch[1], but makes the\n... | sql | chosen |
[
{
"from": "system",
"value": "Use TEXT instead of VARCHAR for repository name in postgres\n"
},
{
"from": "human",
"value": "CREATE EXTENSION IF NOT EXISTS pgcrypto;\n\nCREATE TABLE repositories (\n id UUID PRIMARY KEY DEFAULT gen_random_uuid(),\n name ... | sql | chosen |
[
{
"from": "system",
"value": "Add valid start and end dates, in case the boundaries of the summer season change\n"
},
{
"from": "human",
"value": "\n-- rambler up\n\n--\n-- This table defines the liturigal seasons that set the base color, name,\n-- notes, and services for each part of the year\n... | sql | chosen |
[
{
"from": "system",
"value": "Update travis database creation script\n"
},
{
"from": "human",
"value": "CREATE SCHEMA main;\nALTER USER \"www-data\" PASSWORD 'www-data';\nGRANT SELECT ON spatial_ref_sys TO \"www-data\";\nGRANT ALL ON SCHEMA main TO \"www-data\";\nGRANT ALL ON geometry_columns TO... | sql | chosen |
[
{
"from": "system",
"value": "Revert \"drop the _pk index to resolve issue with repeatable migrations\"\n"
},
{
"from": "human",
"value": "--\n-- Copyright 2010-2017 Boxfuse GmbH\n--\n-- Licensed under the Apache License, Version 2.0 (the \"License\");\n-- you may not use this file except in com... | sql | chosen |
[
{
"from": "system",
"value": "Fix typo in db patch\n"
},
{
"from": "human",
"value": "-- Add the ratings column to the event_comments table\nALTER TABLE event_comments ADD COLUMN `rating` int(11) default NULL, ;\n \n-- Increase patch count\nINSERT INTO patch_history SET patch_number = 55;"
... | sql | chosen |
[
{
"from": "system",
"value": "Add otp field to clients column.\n\n"
},
{
"from": "human",
"value": "-- DROP DATABASE ykval;\nCREATE DATABASE ykval;\nUSE ykval;\n\nCREATE TABLE clients (\n id INT NOT NULL AUTO_INCREMENT,\n active BOOLEAN DEFAULT TRUE,\n created DATETIME NOT NULL,\n secret VAR... | sql | chosen |
[
{
"from": "system",
"value": "Add (`thread`, `id`) multi-column key to optimize rebuilding index pages.\n\nThis SQL command can be used to add the key to existing board tables:\ncreate index `thread_id` on posts_%s (`thread`, `id`);\n"
},
{
"from": "human",
"value": "CREATE TABLE IF NOT EXISTS `... | sql | chosen |
[
{
"from": "system",
"value": "Fix Stats table full script to include R10.2-3 updates\n"
},
{
"from": "human",
"value": "CREATE DATABASE `dbs_statistics` /*!40100 DEFAULT CHARACTER SET utf8 */\n\n\nCREATE TABLE `citations` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `data_source_id` mediumint(8... | sql | chosen |
[
{
"from": "system",
"value": "Remove hash from grades table\n"
},
{
"from": "human",
"value": "DROP TABLE IF EXISTS users;\nCREATE TABLE users (\n\tuid INTEGER PRIMARY KEY AUTOINCREMENT,\n\tusername TEXT UNIQUE NOT NULL,\n\tname TEXT NOT NULL,\n\temail TEXT NOT NULL\n);\n\ndrop table if exists c... | sql | chosen |
[
{
"from": "system",
"value": "Add APM user for monitoring MySQL\n"
},
{
"from": "human",
"value": "--\n-- Add demo user\n--\n\nCREATE USER 'demo'@'localhost' IDENTIFIED BY 'welcome1';\nGRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, EXECUTE ON *.* TO 'demo'@'localhost';\nCREATE USER 'demo'@'%... | sql | chosen |
[
{
"from": "system",
"value": "Add db change to the original sql file\n\nThis will make sure any new install install will get the new metadata\n\nChange-Id: I4c1f190ea7b2297cfdc1c9045d43571517c11f3e\n"
},
{
"from": "human",
"value": "-- Article metadata types\nCREATE TABLE /*_*/pagetriage_tags (\... | sql | chosen |
[
{
"from": "system",
"value": "Add a few timestamps to the tables.\n"
},
{
"from": "human",
"value": "# ---!Ups\ncreate table users(\n id bigserial not null primary key,\n username varchar(255) not null,\n password varchar(64) not null,\n salt varchar(36) not null,\n name varchar(255) not nu... | sql | chosen |
[
{
"from": "system",
"value": "Format the RSVP Schema script.\n"
},
{
"from": "human",
"value": "CREATE TABLE IF NOT EXISTS reservation (\n id SERIAL,\n reservation_title VARCHAR(255) NOT NULL,\n address_line_one VARCHAR(500),\n add... | sql | chosen |
[
{
"from": "system",
"value": "Redefine itrim and otrim to be integer milliseconds\n"
},
{
"from": "human",
"value": "-- Table names are flush left, and column definitions are\n-- indented by at least one space or tab. Blank lines and\n-- lines beginning with a double hyphen are comments.\n\ntrac... | sql | chosen |
[
{
"from": "system",
"value": "Add SQL to extract Finnish PAs\n"
},
{
"from": "human",
"value": "SELECT *\nINTO wdpa.wdpa_poly_fin\nFROM wdpa.wdpa_poly\nWHERE iso3 = 'FIN';\n\n-- Define a primary key\nALTER TABLE wdpa.wdpa_poly_fin ADD PRIMARY KEY (gid);\n\n-- Spatially enable it\nSELECT Populat... | sql | chosen |
[
{
"from": "system",
"value": "Fix long name for TAS in update sql\n"
},
{
"from": "human",
"value": "UPDATE linked_system SET beskrivelse = 'Det Fælles Medicinkort' where kode = 'FMK';\nUPDATE linked_system SET beskrivelse = 'Det Danske Vaccinationsregister' where kode = 'DDV';\nUPDATE linked_sy... | sql | chosen |
[
{
"from": "system",
"value": "Add global criteria in DB\n"
},
{
"from": "human",
"value": "DROP TABLE IF EXISTS `glpi_plugin_fusinvinventory_criteria`;\n\nCREATE TABLE `glpi_plugin_fusinvinventory_criteria` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `name` varchar(255) COLLATE utf8_unicode_ci... | sql | chosen |
[
{
"from": "system",
"value": "Fix the data point resource ID in the sample data.\n"
},
{
"from": "human",
"value": "INSERT INTO oauth_client_details (\n client_id,\n client_secret,\n scope,\n resource_ids,\n authorized_grant_types,\n authorities\n)\nVALUES (\n 'testClient',\n 'testClient... | sql | chosen |
[
{
"from": "system",
"value": "Remove autoincrement since we incrementing the ID in the storage layer\n"
},
{
"from": "human",
"value": "/* Copyright 2015 OpenMarket Ltd\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance wi... | sql | chosen |
[
{
"from": "system",
"value": "fix(db): Fix an old db patch to apply cleanly in local dev.\n"
},
{
"from": "human",
"value": "-- Add refreshTokens\n\nCREATE TABLE refreshTokens (\n token BINARY(32) PRIMARY KEY,\n clientId BINARY(8) NOT NULL,\n INDEX tokens_client_id(clientId),\n FOREIGN KEY (... | sql | chosen |
[
{
"from": "system",
"value": "Add UUID to trails view"
},
{
"from": "human",
"value": "CREATE VIEW {# geotrek.core #}.v_trails AS (\n SELECT core_topology.geom, core_topology.id, core_trail.*\n FROM core_trail, core_topology\n WHERE core_trail.topo_object_id = core_topology.id\n AND ... | sql | chosen |
[
{
"from": "system",
"value": "Fix sql procedure to give better names.\n\nWe want to match the names in ScoreEntry.\n"
},
{
"from": "human",
"value": "-- Select top 10 result in total\n\nDELIMITER //\nCREATE PROCEDURE GetGlobalTopTen ()\n BEGIN \n SELECT nickname, score\n FROM (Score\... | sql | chosen |
[
{
"from": "system",
"value": "Improve back-compatibility of database evolutions\n\nChange default authentication realm from 'default' to 'tuid' to\nimprove back-compatibility as all pre-existing accounts have that\nOAuth provider.\n"
},
{
"from": "human",
"value": "--\n-- Telefónica Digital - Pr... | sql | chosen |
[
{
"from": "system",
"value": "Fix cluster zone index syntax error\n"
},
{
"from": "human",
"value": "ALTER TABLE cluster\n\tADD COLUMN zone VARCHAR(50) NOT NULL;\n\nCREATE INDEX cluster_zone_idx\n\tON cluster (zone(767));\n"
},
{
"from": "gpt",
"value": "ALTER TABLE cluster\n\tADD CO... | sql | chosen |
[
{
"from": "system",
"value": "Use single-quotes around string literals used in SQL statements\n\nIf sqlite is built with -DSQLITE_DQS=0 in accordance with\nhttps://sqlite.org/quirks.html#dblquote, migration to version 1.2 of the\nhistory database would fail with:\n\n History database cannot be created: /va... | sql | chosen |
[
{
"from": "system",
"value": "Change Robs position to Project Advisor.\n"
},
{
"from": "human",
"value": "update xcolab_StaffMember set role=\"CCI Associate Director\" where id_=149;\nupdate xcolab_StaffMember set role=\"Project Manager\" where id_=150;\nupdate xcolab_StaffMember set categoryId=... | sql | chosen |
[
{
"from": "system",
"value": "Relent: Put @ on annotation names.\n"
},
{
"from": "human",
"value": "insert into annotation(id,api,name,usage) values(-1,'Lang', 'Override','Ensure method overrides superclass method');\ninsert into annotation(id,api,name,usage) values(-2,'JSF', 'EJB', 'Request in... | sql | chosen |
[
{
"from": "system",
"value": "Change test to use anonymous code block instead of redirection to file\n"
},
{
"from": "human",
"value": "\\set ECHO none\nSET search_path TO provsql_test, provsql;\n\nCREATE TABLE test(id varchar PRIMARY KEY, v integer);\n\nINSERT INTO test(id,v) VALUES\n\t('hello'... | sql | chosen |
[
{
"from": "system",
"value": "Add index to temp table\n"
},
{
"from": "human",
"value": "/* Copyright 2019 The Matrix.org Foundation C.I.C.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may o... | sql | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.