-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added updated by fields to embeds model (#173)
* CHARTS-10118 added updated by fields to model * Review fix: set updated_at values from created_at
- Loading branch information
Showing
3 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/db/migrations/20240821143300_embeds_change_updated_by_to_not_null.ts
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 @@ | ||
import {Knex} from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
return knex.raw(` | ||
UPDATE embeds SET updated_by = created_by, updated_at = created_at; | ||
ALTER TABLE embeds ALTER COLUMN updated_by SET NOT NULL; | ||
`); | ||
} | ||
|
||
export async function down(knex: Knex): Promise<void> { | ||
return knex.raw(` | ||
ALTER TABLE embeds ALTER COLUMN updated_by DROP NOT NULL; | ||
`); | ||
} |
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