-
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
f98fbc3
commit 4236afe
Showing
6 changed files
with
34 additions
and
18 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
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
1 change: 1 addition & 0 deletions
1
web/backend/migrations/2024-02-08-100852_create_manifactured_item_types_table/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 |
---|---|---|
@@ -0,0 +1 @@ | ||
-- This file should undo anything in `up.sql` |
17 changes: 17 additions & 0 deletions
17
web/backend/migrations/2024-02-08-100852_create_manifactured_item_types_table/up.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-- SQL defining the manufactured_item_types table. | ||
-- A manufactured type is an item type that can be manufactured, sold, and bought. As such it | ||
-- has a cost, its currency, and a cost per day for renting and the current of the renting | ||
-- cost. | ||
CREATE TABLE manufactured_item_types ( | ||
id SERIAL PRIMARY KEY, | ||
item_type_id INTEGER REFERENCES item_types(id), | ||
cost DECIMAL(10, 2) NOT NULL, | ||
cost_per_day DECIMAL(10, 2) NOT NULL, | ||
currency VARCHAR(3) NOT NULL, | ||
manifacturer_id INTEGER REFERENCES organizations(id), | ||
barcode VARCHAR(255) NOT NULL UNIQUE, | ||
created_by INTEGER REFERENCES users(id), | ||
updated_by INTEGER REFERENCES users(id), | ||
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP, | ||
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP | ||
); |
2 changes: 2 additions & 0 deletions
2
web/backend/migrations/2024-02-08-101004_create_expirable_item_types_table/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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- This file should undo anything in `up.sql` | ||
DROP TABLE expirable_item_types; |
13 changes: 13 additions & 0 deletions
13
web/backend/migrations/2024-02-08-101004_create_expirable_item_types_table/up.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- SQL defining the expirable_item_types table. | ||
-- Item types appearing in this table have an expiration date, meaning that | ||
-- they have an interval of time associated to them after which they are no longer | ||
-- valid. This table is used to enforce the expiration date of items of a certain type. | ||
CREATE TABLE expirable_item_types ( | ||
id SERIAL PRIMARY KEY, | ||
item_type_id INTEGER REFERENCES item_types(id), | ||
expiration_interval INTERVAL NOT NULL, | ||
created_by INTEGER REFERENCES users(id), | ||
updated_by INTEGER REFERENCES users(id), | ||
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP, | ||
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP | ||
); |