This repository has been archived by the owner on Nov 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
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
005c9ab
commit bc1ac53
Showing
21 changed files
with
1,128 additions
and
204 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
11 changes: 4 additions & 7 deletions
11
backend/services/core/migrations/20230810103128_fix_webshop_release_date.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 |
---|---|---|
@@ -1,22 +1,19 @@ | ||
import { Knex } from "knex"; | ||
|
||
import { Knex } from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
await knex.schema.alterTable('product_inventory', (table) => { | ||
table.dropColumn('release_date'); | ||
}); | ||
await knex.schema.alterTable('product', (table) => { | ||
table.timestamp('release_date').notNullable(); | ||
}) | ||
table.timestamp('release_date').notNullable().defaultTo(knex.fn.now()); | ||
}); | ||
} | ||
|
||
|
||
export async function down(knex: Knex): Promise<void> { | ||
await knex.schema.alterTable('product_inventory', (table) => { | ||
table.timestamp('release_date').defaultTo(knex.fn.now()); | ||
}); | ||
await knex.schema.alterTable('product', (table) => { | ||
table.dropColumn('release_date'); | ||
}) | ||
}); | ||
} | ||
|
5 changes: 1 addition & 4 deletions
5
backend/services/core/migrations/20230810130719_make-product-price-numeric.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 |
---|---|---|
@@ -1,16 +1,13 @@ | ||
import { Knex } from "knex"; | ||
|
||
import { Knex } from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
await knex.schema.alterTable('product', (table) => { | ||
table.decimal('price', 8, 2).notNullable().alter(); | ||
}); | ||
} | ||
|
||
|
||
export async function down(knex: Knex): Promise<void> { | ||
await knex.schema.alterTable('product', (table) => { | ||
table.integer('price').notNullable().alter(); | ||
}); | ||
} | ||
|
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
Oops, something went wrong.