-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT] Added Postgres timestamp table columns (#75)
* FEAT: [gw] Add timestamp columns to Postgres tables * TASK: [doc] Various (/simple) documentation updates
- Loading branch information
Showing
11 changed files
with
100 additions
and
9 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
10 changes: 10 additions & 0 deletions
10
crates/gateway/migrations/postgres/2024-02-28-000000_add_timestamp_columns/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,10 @@ | ||
ALTER TABLE roles DROP COLUMN created_at; | ||
ALTER TABLE roles DROP COLUMN updated_at; | ||
ALTER TABLE services DROP COLUMN created_at; | ||
ALTER TABLE services DROP COLUMN updated_at; | ||
ALTER TABLE service_accesses DROP COLUMN created_at; | ||
ALTER TABLE service_accesses DROP COLUMN updated_at; | ||
ALTER TABLE users DROP COLUMN created_at; | ||
ALTER TABLE users DROP COLUMN updated_at; | ||
ALTER TABLE user_roles DROP COLUMN created_at; | ||
ALTER TABLE user_roles DROP COLUMN updated_at; |
16 changes: 16 additions & 0 deletions
16
crates/gateway/migrations/postgres/2024-02-28-000000_add_timestamp_columns/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,16 @@ | ||
ALTER TABLE roles ADD COLUMN created_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP; | ||
ALTER TABLE roles ADD COLUMN updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP; | ||
ALTER TABLE services ADD COLUMN created_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP; | ||
ALTER TABLE services ADD COLUMN updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP; | ||
ALTER TABLE service_accesses ADD COLUMN created_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP; | ||
ALTER TABLE service_accesses ADD COLUMN updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP; | ||
ALTER TABLE users ADD COLUMN created_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP; | ||
ALTER TABLE users ADD COLUMN updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP; | ||
ALTER TABLE user_roles ADD COLUMN created_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP; | ||
ALTER TABLE user_roles ADD COLUMN updated_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP; | ||
|
||
SELECT diesel_manage_updated_at('roles'); | ||
SELECT diesel_manage_updated_at('services'); | ||
SELECT diesel_manage_updated_at('service_accesses'); | ||
SELECT diesel_manage_updated_at('users'); | ||
SELECT diesel_manage_updated_at('user_roles'); |
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
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
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