qt-chat-app

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

U1766766317__alter_table_profile.sql (511B)


      1 PRAGMA foreign_keys = OFF;
      2 
      3 CREATE TABLE "__alter_table_profile" (
      4     'id' INTEGER PRIMARY KEY NOT NULL,
      5     'user_id' BLOB NOT NULL REFERENCES '_user'('id') UNIQUE,
      6     'name' TEXT NOT NULL
      7 ) STRICT;
      8 
      9 INSERT INTO
     10     "__alter_table_profile" ("id", "user_id", "name")
     11 SELECT
     12     "id",
     13     "_user_id",
     14     "name"
     15 FROM
     16     "profile";
     17 
     18 DROP TABLE "profile";
     19 
     20 PRAGMA legacy_alter_table = ON;
     21 
     22 ALTER TABLE
     23     "__alter_table_profile" RENAME TO "profile";
     24 
     25 PRAGMA legacy_alter_table = OFF;
     26 
     27 PRAGMA foreign_keys = ON;