-
Notifications
You must be signed in to change notification settings - Fork 5
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
Showing
23 changed files
with
587 additions
and
13 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
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
17 changes: 17 additions & 0 deletions
17
migrations/schemas/20240918064436-add_table_physical_checkin_transactions.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 @@ | ||
|
||
-- +migrate Up | ||
CREATE TABLE physical_checkin_transactions ( | ||
id uuid PRIMARY KEY DEFAULT (uuid()), | ||
employee_id UUID REFERENCES employees(id) NOT NULL, | ||
date DATE NOT NULL, | ||
icy_amount FLOAT8 DEFAULT 0.0, | ||
mochi_tx_id INTEGER | ||
); | ||
-- add unique constraint | ||
CREATE UNIQUE INDEX physical_checkin_transactions_employee_id_date_idx ON physical_checkin_transactions(employee_id, date); | ||
|
||
|
||
-- +migrate Down | ||
DROP TABLE physical_checkin_transactions; | ||
|
||
|
14 changes: 14 additions & 0 deletions
14
migrations/schemas/20240919023432-alter_table_checkins_update_id_type.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,14 @@ | ||
|
||
-- +migrate Up | ||
ALTER TABLE physical_checkins DROP CONSTRAINT physical_checkins_pkey; | ||
ALTER TABLE physical_checkins DROP COLUMN id; | ||
ALTER TABLE physical_checkins ADD COLUMN id uuid PRIMARY KEY DEFAULT (uuid()); | ||
ALTER TABLE discord_checkins DROP CONSTRAINT discord_checkins_pkey; | ||
ALTER TABLE discord_checkins DROP COLUMN id; | ||
ALTER TABLE discord_checkins ADD COLUMN id uuid PRIMARY KEY DEFAULT (uuid()); | ||
|
||
-- +migrate Down | ||
ALTER TABLE physical_checkins DROP CONSTRAINT physical_checkins_pkey; | ||
ALTER TABLE physical_checkins ADD COLUMN id SERIAL PRIMARY KEY; | ||
ALTER TABLE discord_checkins DROP CONSTRAINT discord_checkins_pkey; | ||
ALTER TABLE discord_checkins ADD COLUMN id SERIAL PRIMARY KEY; |
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
Oops, something went wrong.