-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3e1b70
commit 15e9733
Showing
5 changed files
with
51 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
sqlite/migrations/20241207083236_add_carbs_release_speed_information_to_nutritions.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
ALTER TABLE nutritions | ||
DROP COLUMN carbs_slow_release_per_100g; | ||
DROP COLUMN carbs_fast_release_per_100g; | ||
|
||
ALTER TABLE nutritions | ||
DROP COLUMN carbs_fast_release_per_100g; | ||
DROP COLUMN carbs_slow_release_per_100g; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 20 additions & 1 deletion
21
sqlite/migrations/20241208175128_add_liquid_column_to_portions.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,20 @@ | ||
ALTER TABLE portions DROP COLUMN liquid; | ||
CREATE TABLE IF NOT EXISTS portions_backup | ||
( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
name TEXT NOT NULL, | ||
owner_id INTEGER REFERENCES users, | ||
language_id INTEGER REFERENCES languages, | ||
weigth_in_grams REAL, | ||
volume_in_ml REAL, | ||
CHECK (volume_in_ml >= 0), | ||
CHECK (weigth_in_grams >= 0), | ||
CHECK (weigth_in_grams IS NOT NULL OR volume_in_ml IS NOT NULL) | ||
); | ||
|
||
INSERT INTO portions_backup | ||
SELECT id, name, owner_id, language_id, weigth_in_grams, volume_in_ml FROM portions; | ||
|
||
DROP TABLE IF EXISTS portions; | ||
|
||
ALTER TABLE portions_backup RENAME TO portions; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters