Compare commits
2
Commits
master
...
c18098cb8a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c18098cb8a | ||
|
|
2bad759547 |
@@ -1,5 +1,4 @@
|
|||||||
-- Add migration script here
|
-- Add migration script here
|
||||||
ALTER TABLE
|
|
||||||
users
|
ALTER TABLE users
|
||||||
ADD
|
ADD COLUMN language Text NOT NULL DEFAULT "en";
|
||||||
COLUMN language Text NOT NULL DEFAULT "en";
|
|
||||||
@@ -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;
|
||||||
Reference in New Issue
Block a user