-
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.
fix: allow non Integers for hoursPerWeek
- Loading branch information
Showing
8 changed files
with
44 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
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 @@ | ||
declare const _default: import("vite").UserConfig; | ||
export default _default; |
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,19 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
||
export class DurationAsDecimal1725025225336 implements MigrationInterface { | ||
name = 'DurationAsDecimal1725025225336' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
|
||
await queryRunner.query(`ALTER TABLE "working_hours" ALTER COLUMN "duration" SET DATA TYPE numeric`); | ||
await queryRunner.query(`CREATE TYPE "public"."contract_data_startmonth_enum" AS ENUM('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12')`); | ||
await queryRunner.query(`ALTER TABLE "contract_data" ALTER COLUMN "startMonth" SET DATA TYPE "public"."contract_data_startmonth_enum" USING ("startMonth"::text::contract_data_startmonth_enum)`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "working_hours" ALTER COLUMN "duration" SET DATA TYPE integer`); | ||
await queryRunner.query(`ALTER TABLE "contract_data" ALTER COLUMN "startMonth" SET DATA TYPE integer USING ("startMonth"::integer)`); | ||
await queryRunner.query(`DROP TYPE "public"."contract_data_startmonth_enum"`); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
server/migrations/1725025788350-hoursPerWeek_as_decimal.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 { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
||
export class HoursPerWeekAsDecimal1725025788350 implements MigrationInterface { | ||
name = 'HoursPerWeekAsDecimal1725025788350' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "contract_data" ALTER COLUMN "hoursPerWeek" SET DATA TYPE numeric`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "contract_data" ALTER COLUMN "hoursPerWeek" SET DATA TYPE integer`); | ||
} | ||
|
||
} |
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