diff options
| author | Shulhan <ms@kilabit.info> | 2021-04-27 10:44:25 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2021-04-27 10:44:25 +0700 |
| commit | 3d4102ec38177870358a87db356a7ad8b2569caa (patch) | |
| tree | d8ec538ab1500fc779985a81d0fcef038e7cc4b7 | |
| parent | f6e0e032260885a00a257bb1b82f3ad3a4c05c36 (diff) | |
| download | pakakeh.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.
| -rw-r--r-- | lib/sql/client.go | 1 |
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) |
