Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PRAGMA foreign_keys = 0;
- CREATE TABLE sqlitestudio_temp_table AS SELECT *
- FROM mark;
- DROP TABLE mark;
- CREATE TABLE mark (
- id_mark INTEGER PRIMARY KEY AUTOINCREMENT
- NOT NULL,
- points INTEGER,
- id_topic INTEGER REFERENCES topic (id_topic) ON DELETE CASCADE
- ON UPDATE CASCADE
- NOT NULL,
- id_user REFERENCES users (id_user) ON DELETE CASCADE
- ON UPDATE CASCADE
- NOT NULL
- );
- INSERT INTO mark (
- id_mark,
- points
- )
- SELECT id_mark,
- points
- FROM sqlitestudio_temp_table;
- DROP TABLE sqlitestudio_temp_table;
- PRAGMA foreign_keys = 1;
Advertisement
Add Comment
Please, Sign In to add comment