aboutsummaryrefslogtreecommitdiff
path: root/lib/sql/client.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-04-27 10:44:25 +0700
committerShulhan <ms@kilabit.info>2021-04-27 10:44:25 +0700
commit3d4102ec38177870358a87db356a7ad8b2569caa (patch)
treed8ec538ab1500fc779985a81d0fcef038e7cc4b7 /lib/sql/client.go
parentf6e0e032260885a00a257bb1b82f3ad3a4c05c36 (diff)
downloadpakakeh.go-3d4102ec38177870358a87db356a7ad8b2569caa.tar.xz
sql: make the column filename on table _migration as primary key
This will allow deleting the record by filename instead of requiring all columns.
Diffstat (limited to 'lib/sql/client.go')
-rw-r--r--lib/sql/client.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/sql/client.go b/lib/sql/client.go
index eb559e2e..e6da7508 100644
--- a/lib/sql/client.go
+++ b/lib/sql/client.go
@@ -205,6 +205,7 @@ func (cl *Client) migrateCreateTable() (err error) {
CREATE TABLE _migration (
filename VARCHAR(1024)
, applied_at TIMESTAMP DEFAULT NOW()
+ , PRIMARY KEY(filename)
);
`
_, err = cl.DB.Exec(q)