diff options
Diffstat (limited to 'model/migrations')
-rw-r--r-- | model/migrations/migration001.go | 15 | ||||
-rw-r--r-- | model/migrations/migration001.sql | 29 |
2 files changed, 0 insertions, 44 deletions
diff --git a/model/migrations/migration001.go b/model/migrations/migration001.go deleted file mode 100644 index 11f062f..0000000 --- a/model/migrations/migration001.go +++ /dev/null @@ -1,15 +0,0 @@ -package migrations - -import ( - "database/sql" - _ "embed" -) - -//go:embed migration001.sql -var migration001sql string - -func Migration001(tx *sql.Tx) error { - _, err := tx.Exec(migration001sql) - - return err -} diff --git a/model/migrations/migration001.sql b/model/migrations/migration001.sql deleted file mode 100644 index 46f9fc6..0000000 --- a/model/migrations/migration001.sql +++ /dev/null @@ -1,29 +0,0 @@ -PRAGMA foreign_keys = ON; - -CREATE TABLE recipes ( - id INTEGER PRIMARY KEY, - title TEXT NOT NULL, - portions INTEGER NOT NULL, - url TEXT NOT NULL, - notes TEXT NOT NULL, - created INTEGER NOT NULL, -- Unix time stamp - last_changed INTEGER NOT NULL -- Unix time stamp -); - -CREATE TABLE steps ( - id INTEGER PRIMARY KEY, - 'index' INTEGER NOT NULL, - text TEXT NOT NULL, - recipe INTEGER NOT NULL, - FOREIGN KEY(recipe) REFERENCES recipes(id) -); - -CREATE TABLE ingredients ( - id INTEGER PRIMARY KEY, - 'index' INTEGER NOT NULL, - amount REAL NOT NULL, - unit TEXT NOT NULL, - 'type' TEXT NOT NULL, - step INTEGER NOT NULL, - FOREIGN KEY(step) REFERENCES steps(id) -); |