Compare commits
2 Commits
0ed010b78f
...
c18098cb8a
Author | SHA1 | Date | |
---|---|---|---|
c18098cb8a | |||
2bad759547 |
@ -1,5 +1,4 @@
|
||||
-- Add migration script here
|
||||
ALTER TABLE
|
||||
users
|
||||
ADD
|
||||
COLUMN language Text NOT NULL DEFAULT "en";
|
||||
|
||||
ALTER TABLE users
|
||||
ADD COLUMN language Text NOT NULL DEFAULT "en";
|
24
migrations/20210401070030_on_delete_cascade.sql
Normal file
24
migrations/20210401070030_on_delete_cascade.sql
Normal file
@ -0,0 +1,24 @@
|
||||
-- Add migration script here
|
||||
PRAGMA foreign_keys = off;
|
||||
|
||||
|
||||
CREATE TABLE new_clicks (
|
||||
id INTEGER PRIMARY KEY NOT NULL,
|
||||
link INT NOT NULL,
|
||||
created_at TIMESTAMP NOT NULL,
|
||||
FOREIGN KEY (link) REFERENCES links (id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
INSERT INTO
|
||||
new_clicks
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
clicks;
|
||||
|
||||
|
||||
DROP TABLE clicks;
|
||||
ALTER TABLE
|
||||
new_clicks RENAME TO clicks;
|
||||
|
||||
PRAGMA foreign_keys = on;
|
Loading…
Reference in New Issue
Block a user