diff --git a/src/client/shared/db/migrations/002_user_votes.sql b/src/client/shared/db/migrations/002_user_votes.sql new file mode 100644 index 0000000..8cb6d54 --- /dev/null +++ b/src/client/shared/db/migrations/002_user_votes.sql @@ -0,0 +1,6 @@ +CREATE TABLE IF NOT EXISTS user_votes ( + legislation_id INTEGER NOT NULL, + vote TEXT NOT NULL CHECK (vote IN ('ja', 'nein', 'enthaltung')), + voted_at TIMESTAMPTZ NOT NULL DEFAULT now(), + PRIMARY KEY (legislation_id) +); diff --git a/src/client/shared/db/migrations/index.ts b/src/client/shared/db/migrations/index.ts index 85c434c..dfa15cf 100644 --- a/src/client/shared/db/migrations/index.ts +++ b/src/client/shared/db/migrations/index.ts @@ -1,3 +1,4 @@ import init from "./001_init.sql?raw" +import userVotes from "./002_user_votes.sql?raw" -export const migrations: string[] = [init] +export const migrations: string[] = [init, userVotes]