summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorGrailFinder <wohilas@gmail.com>2024-04-08 09:58:45 +0300
committerGrailFinder <wohilas@gmail.com>2024-04-08 09:58:45 +0300
commit499dcd25aa8d1f878b379e2ca8f94417807c4afb (patch)
tree3dab7029d2ee558e3fe715dc62e9ff7ff86a9533 /internal
parent4a42a4465c8ff5496229f8883b9d1532bf7c9cab (diff)
Fix: migrations
Diffstat (limited to 'internal')
-rw-r--r--internal/database/migrations/001_init.down.sql4
-rw-r--r--internal/database/migrations/001_init.up.sql6
-rw-r--r--internal/database/migrations/migrations.bindata.go8
3 files changed, 9 insertions, 9 deletions
diff --git a/internal/database/migrations/001_init.down.sql b/internal/database/migrations/001_init.down.sql
index 4b46d47..1b8680f 100644
--- a/internal/database/migrations/001_init.down.sql
+++ b/internal/database/migrations/001_init.down.sql
@@ -1,4 +1,4 @@
BEGIN;
-DROP TABLE IF EXISTS user_score;
-DROP TABLE IF EXISTS action;
+DROP SCHEMA public CASCADE;
+CREATE SCHEMA public;
COMMIT;
diff --git a/internal/database/migrations/001_init.up.sql b/internal/database/migrations/001_init.up.sql
index 7edbd96..80ebcad 100644
--- a/internal/database/migrations/001_init.up.sql
+++ b/internal/database/migrations/001_init.up.sql
@@ -4,18 +4,18 @@ CREATE TABLE user_score (
username TEXT UNIQUE NOT NULL,
burn_time TIMESTAMP NOT NULL DEFAULT NOW() + interval '1 day',
score SMALLINT NOT NULL,
- created_at timestamp NOT NULL DEFAULT NOW()
+ created_at TIMESTAMP NOT NULL DEFAULT NOW()
);
CREATE TABLE action (
id INT GENERATED BY DEFAULT AS IDENTITY,
name TEXT NOT NULL,
- magnitude SMALLSERIAL NOT NULL DEFAULT 1,
+ magnitude SMALLINT NOT NULL DEFAULT 1,
repeatable BOOLEAN NOT NULL DEFAULT FALSE,
type TEXT NOT NULL,
done BOOLEAN NOT NULL DEFAULT FALSE,
username TEXT NOT NULL,
- created_at timestamp NOT NULL DEFAULT NOW(),
+ created_at TIMESTAMP NOT NULL DEFAULT NOW(),
UNIQUE(username, name),
CONSTRAINT fk_user_score
FOREIGN KEY(username)
diff --git a/internal/database/migrations/migrations.bindata.go b/internal/database/migrations/migrations.bindata.go
index 8197c0a..a3276ee 100644
--- a/internal/database/migrations/migrations.bindata.go
+++ b/internal/database/migrations/migrations.bindata.go
@@ -78,7 +78,7 @@ func (fi bindataFileInfo) Sys() interface{} {
return nil
}
-var __001_initDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x72\x75\xf7\xf4\xb3\xe6\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\xf0\x74\x53\x70\x8d\xf0\x0c\x0e\x09\x56\x28\x2d\x4e\x2d\x8a\x2f\x4e\xce\x2f\x4a\xc5\xa1\x20\x31\xb9\x24\x33\x3f\xcf\x9a\xcb\xd9\xdf\xd7\xd7\x33\xc4\x9a\x0b\x10\x00\x00\xff\xff\x8c\xa0\x7b\x43\x4d\x00\x00\x00")
+var __001_initDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x72\x75\xf7\xf4\xb3\xe6\x72\x09\xf2\x0f\x50\x08\x76\xf6\x70\xf5\x75\x54\x28\x28\x4d\xca\xc9\x4c\x56\x70\x76\x0c\x76\x76\x74\x71\xb5\xe6\x72\x0e\x72\x75\x0c\x71\x45\x95\xb5\xe6\x72\xf6\xf7\xf5\xf5\x0c\xb1\xe6\x02\x04\x00\x00\xff\xff\x47\x78\xff\x61\x41\x00\x00\x00")
func _001_initDownSqlBytes() ([]byte, error) {
return bindataRead(
@@ -93,12 +93,12 @@ func _001_initDownSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "001_init.down.sql", size: 77, mode: os.FileMode(420), modTime: time.Unix(1712472256, 0)}
+ info := bindataFileInfo{name: "001_init.down.sql", size: 65, mode: os.FileMode(420), modTime: time.Unix(1712559447, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
-var __001_initUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x92\x31\x6f\xc2\x30\x10\x85\xf7\xfc\x8a\xb7\x01\x2a\x0b\x33\x93\x13\x2e\xc8\xaa\xe3\xb4\xb6\xa3\x96\x29\x32\xc4\xad\xa2\x42\x40\xc1\x54\xe2\xdf\x57\xc1\x14\x1a\xd1\x4a\x15\xf3\x7d\xf7\xee\xdd\xbd\x8b\x69\xce\xe5\x34\x4a\x14\x31\x43\x30\x2c\x16\x84\xc3\xde\xb5\xe5\x7e\xb5\x6d\x1d\x86\x11\x00\xd4\x15\xb8\x34\x98\x93\x24\xc5\x0c\xcd\x10\x2f\x30\xa3\x94\x15\xc2\x80\x69\xf0\x19\x49\xc3\xcd\x62\x7c\x82\xbb\xee\xc6\x6e\x1c\x0c\xbd\x1a\x14\x92\x3f\x17\x04\x99\x1b\xc8\x42\x88\x80\x2c\x0f\x6d\x53\xfa\xba\x63\x78\x46\xda\xb0\xec\xe9\x42\x5c\x84\x65\xfe\x32\x1c\xe1\x01\x75\xe3\x5d\xfb\x69\xd7\x18\x4c\x50\xd9\xe3\x20\x48\x04\x7b\x3a\x63\x42\x74\xd6\xfa\xfa\xab\xd6\x59\xef\xaa\xd2\x7a\x74\x53\xf6\xde\x6e\x76\x7f\x0c\x88\x46\xd3\xa8\xbf\xbd\x5d\xf9\x7a\xdb\xdc\xb3\xf9\x75\xeb\xbe\x9d\x8d\x7d\x6f\x6a\x7f\xa8\xce\x7e\x35\x29\xce\xc4\xad\x9f\x49\xa0\x5b\xb7\x73\xd6\xdb\xe5\xda\x21\xce\x73\x41\x4c\xde\xa2\x29\x13\x9a\x02\xee\x8f\xbb\x5f\x87\x56\xdb\xe6\x7f\x02\xfd\xbc\xee\x3e\x64\x68\x08\x71\x0f\xbf\x35\xc7\xa7\x9b\x9c\x6b\x49\x2e\xb5\x51\xac\xbb\xe7\xdb\x47\x79\x7d\xb2\x53\x11\x48\x73\x45\x7c\x2e\xf1\x48\x8b\x4b\xff\x08\xe7\xa2\xa2\x94\x14\xc9\x84\xf4\x8f\xef\xbc\x62\x5d\x8a\x49\x9e\x65\xdc\x4c\xa3\xaf\x00\x00\x00\xff\xff\x2f\x40\x52\xc4\xd2\x02\x00\x00")
+var __001_initUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x92\x41\x6f\x82\x40\x10\x85\xef\xfc\x8a\x77\x53\x53\x2f\x9e\x3d\x2d\x38\x98\x4d\x97\xdd\x16\x96\xb4\x9e\xc8\x2a\xdb\x86\x54\xd1\xe0\xda\xc4\x7f\xdf\xe0\x5a\x28\xa9\x49\x1b\xcf\xf3\xcd\x9b\xf7\x66\x26\xa4\x25\x97\xf3\x20\x4a\x89\x69\x82\x66\xa1\x20\x9c\x8e\xb6\x29\x8e\x9b\x7d\x63\x31\x0e\x00\xa0\x2a\xc1\xa5\xc6\x92\x24\xa5\x4c\xd3\x02\xe1\x0a\x0b\x8a\x59\x2e\x34\x58\x06\xbe\x20\xa9\xb9\x5e\x4d\x2f\x70\xdb\x5d\x9b\x9d\x85\xa6\x57\x8d\x5c\xf2\xe7\x9c\x20\x95\x86\xcc\x85\xf0\xc8\xfa\xd4\xd4\x85\xab\x5a\x86\x27\x94\x69\x96\x3c\x75\x44\x27\x2c\xd5\xcb\x78\x82\x07\x54\xb5\xb3\xcd\xa7\xd9\x62\x34\x43\x69\xce\x23\x2f\xe1\xed\x65\x09\x13\xa2\xb5\x36\xd4\xdf\x34\xd6\x38\x5b\x16\xc6\xfd\x39\x20\x98\xcc\x83\x61\x7a\xb3\x71\xd5\xbe\xbe\x27\x79\x9f\x7a\x68\x67\x67\xde\xeb\xca\x9d\xca\x1b\x7e\x3b\xb1\x99\x47\x1b\x7b\xb0\xc6\x99\xf5\xd6\x22\x54\x4a\x10\x93\xbf\xd1\x98\x89\x8c\x3c\xee\xce\x87\x9b\x13\xcb\x7d\xfd\x3f\x81\xe1\xb1\xee\xde\xa2\x6f\xf0\xb7\x1e\x7f\x6b\x4e\x2f\x0b\xb9\xd6\x22\x25\x33\x9d\xb2\x36\xfb\xdb\x47\xd1\x7f\xd8\xa5\x08\xc4\x2a\x25\xbe\x94\x78\xa4\x55\xd7\x3f\xc1\xb5\x98\x52\x4c\x29\xc9\x88\xb2\x1f\xaf\xd9\x63\xed\x09\x23\x95\x24\x5c\xcf\x83\xaf\x00\x00\x00\xff\xff\x9f\xe9\x59\xfc\xcf\x02\x00\x00")
func _001_initUpSqlBytes() ([]byte, error) {
return bindataRead(
@@ -113,7 +113,7 @@ func _001_initUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "001_init.up.sql", size: 722, mode: os.FileMode(420), modTime: time.Unix(1712472259, 0)}
+ info := bindataFileInfo{name: "001_init.up.sql", size: 719, mode: os.FileMode(420), modTime: time.Unix(1712558242, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}