add unique constraints

This commit is contained in:
Erik Winter 2021-07-24 08:43:05 +02:00
parent ebe2c401ef
commit bf7f5efa1e
2 changed files with 4 additions and 7 deletions

View File

@ -1,14 +1,11 @@
pull:
git pull
test:
go test -cover ./...
deploy-service: pull test
deploy-service: test
go build -o gte-daemon ./cmd/daemon/service.go
scp gte-daemon ewintr.nl:/home/erik/bin/gte-daemon
ssh ewintr.nl /home/erik/bin/deploy-gte-daemon.sh
install-cli: pull test
install-cli: test
go build -o gte ./cmd/cli/main.go
mv gte ${HOME}/bin

View File

@ -13,10 +13,10 @@ import (
type sqliteMigration string
var sqliteMigrations = []sqliteMigration{
`CREATE TABLE task ("id" TEXT, "version" INTEGER, "folder" TEXT, "action" TEXT, "project" TEXT, "due" TEXT, "recur" TEXT)`,
`CREATE TABLE task ("id" TEXT UNIQUE, "version" INTEGER, "folder" TEXT, "action" TEXT, "project" TEXT, "due" TEXT, "recur" TEXT)`,
`CREATE TABLE system ("latest_sync" INTEGER)`,
`INSERT INTO system (latest_sync) VALUES (0)`,
`CREATE TABLE local_id ("id" TEXT, "local_id" INTEGER)`,
`CREATE TABLE local_id ("id" TEXT UNIQUE, "local_id" INTEGER UNIQUE)`,
}
var (