update sqlc.yaml,queries and add new mig files
This commit is contained in:
parent
653404d89b
commit
6524977c9f
@ -292,8 +292,13 @@ INSERT INTO answer(
|
|||||||
fingerprint,
|
fingerprint,
|
||||||
session,
|
session,
|
||||||
result,
|
result,
|
||||||
email
|
email,
|
||||||
) VALUES ($1,$2,$3,$4,$5,$6,$7);
|
device_type,
|
||||||
|
device,
|
||||||
|
os,
|
||||||
|
browser,
|
||||||
|
ip
|
||||||
|
) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12);
|
||||||
|
|
||||||
-- name: GetResultAnswers :many
|
-- name: GetResultAnswers :many
|
||||||
SELECT DISTINCT on (question_id) id, content, quiz_id, question_id, fingerprint, session,created_at, result, new,deleted FROM answer WHERE session = (
|
SELECT DISTINCT on (question_id) id, content, quiz_id, question_id, fingerprint, session,created_at, result, new,deleted FROM answer WHERE session = (
|
||||||
|
6
dal/schema/000006_init.down.sql
Normal file
6
dal/schema/000006_init.down.sql
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
ALTER TABLE answer
|
||||||
|
DROP COLUMN device_type,
|
||||||
|
DROP COLUMN device,
|
||||||
|
DROP COLUMN os,
|
||||||
|
DROP COLUMN browser,
|
||||||
|
DROP COLUMN ip;
|
6
dal/schema/000006_init.up.sql
Normal file
6
dal/schema/000006_init.up.sql
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
ALTER TABLE answer
|
||||||
|
ADD COLUMN device_type VARCHAR(50) NOT NULL DEFAULT '',
|
||||||
|
ADD COLUMN device VARCHAR(100) NOT NULL DEFAULT '',
|
||||||
|
ADD COLUMN os VARCHAR(100) NOT NULL DEFAULT '',
|
||||||
|
ADD COLUMN browser VARCHAR(100) NOT NULL DEFAULT '',
|
||||||
|
ADD COLUMN ip VARCHAR(50) NOT NULL DEFAULT '';
|
@ -14,6 +14,8 @@ packages:
|
|||||||
- "./dal/schema/000004_init.down.sql"
|
- "./dal/schema/000004_init.down.sql"
|
||||||
- "./dal/schema/000005_init.up.sql"
|
- "./dal/schema/000005_init.up.sql"
|
||||||
- "./dal/schema/000005_init.down.sql"
|
- "./dal/schema/000005_init.down.sql"
|
||||||
|
- "./dal/schema/000006_init.up.sql"
|
||||||
|
- "./dal/schema/000006_init.down.sql"
|
||||||
engine: "postgresql"
|
engine: "postgresql"
|
||||||
emit_json_tags: true
|
emit_json_tags: true
|
||||||
emit_db_tags: true
|
emit_db_tags: true
|
||||||
|
Loading…
Reference in New Issue
Block a user