From 106cd195d4b7028de5304d34addcfc4cfc8a9cec Mon Sep 17 00:00:00 2001 From: dr-carrot Date: Sat, 20 Jan 2024 23:58:00 -0500 Subject: [PATCH] fix: added default dates to postgres migration --- .../1705599190375-InitialMigration.ts | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/server/migration/postgres/1705599190375-InitialMigration.ts b/server/migration/postgres/1705599190375-InitialMigration.ts index 6f3a501c2..1be192328 100644 --- a/server/migration/postgres/1705599190375-InitialMigration.ts +++ b/server/migration/postgres/1705599190375-InitialMigration.ts @@ -30,9 +30,9 @@ export class InitialMigration1705599190375 implements MigrationInterface { "imdbId" text, status int default '1'::int, status4k int default '1'::int, - "createdAt" timestamp with time zone, - "updatedAt" timestamp with time zone, - "lastSeasonChange" timestamp with time zone, + "createdAt" timestamp with time zone default CURRENT_TIMESTAMP, + "updatedAt" timestamp with time zone default CURRENT_TIMESTAMP, + "lastSeasonChange" timestamp with time zone default CURRENT_TIMESTAMP, "mediaAddedAt" timestamp with time zone, "serviceId" int, "serviceId4k" int, @@ -54,8 +54,8 @@ export class InitialMigration1705599190375 implements MigrationInterface { id serial, "seasonNumber" int, status int default '1'::int, - "createdAt" timestamp with time zone, - "updatedAt" timestamp with time zone, + "createdAt" timestamp with time zone default CURRENT_TIMESTAMP, + "updatedAt" timestamp with time zone default CURRENT_TIMESTAMP, "mediaId" int, status4k int default '1'::int, constraint idx_194715_season_pkey @@ -90,8 +90,8 @@ export class InitialMigration1705599190375 implements MigrationInterface { "plexToken" text, permissions int default '0'::int, avatar text, - "createdAt" timestamp with time zone, - "updatedAt" timestamp with time zone, + "createdAt" timestamp with time zone default CURRENT_TIMESTAMP, + "updatedAt" timestamp with time zone default CURRENT_TIMESTAMP, password text, "userType" int default '1'::int, "plexUsername" text, @@ -139,8 +139,8 @@ export class InitialMigration1705599190375 implements MigrationInterface { status int default '1'::int, "problemSeason" int default '0'::int, "problemEpisode" int default '0'::int, - "createdAt" timestamp with time zone, - "updatedAt" timestamp with time zone, + "createdAt" timestamp with time zone default CURRENT_TIMESTAMP, + "updatedAt" timestamp with time zone default CURRENT_TIMESTAMP, "mediaId" int, "createdById" int, "modifiedById" int, @@ -159,8 +159,8 @@ export class InitialMigration1705599190375 implements MigrationInterface { ( id serial, message text, - "createdAt" timestamp with time zone, - "updatedAt" timestamp with time zone, + "createdAt" timestamp with time zone default CURRENT_TIMESTAMP, + "updatedAt" timestamp with time zone default CURRENT_TIMESTAMP, "userId" int, "issueId" int, constraint idx_194755_issue_comment_pkey @@ -205,8 +205,8 @@ export class InitialMigration1705599190375 implements MigrationInterface { ( id serial, status int, - "createdAt" timestamp with time zone, - "updatedAt" timestamp with time zone, + "createdAt" timestamp with time zone default CURRENT_TIMESTAMP, + "updatedAt" timestamp with time zone default CURRENT_TIMESTAMP, type text, "mediaId" int, "requestedById" int, @@ -253,8 +253,8 @@ export class InitialMigration1705599190375 implements MigrationInterface { enabled boolean default true, title text, data text, - "createdAt" timestamp with time zone, - "updatedAt" timestamp with time zone, + "createdAt" timestamp with time zone default CURRENT_TIMESTAMP, + "updatedAt" timestamp with time zone default CURRENT_TIMESTAMP, constraint idx_194779_discover_slider_pkey primary key (id) );` @@ -267,8 +267,8 @@ export class InitialMigration1705599190375 implements MigrationInterface { "mediaType" text, title text, "tmdbId" int, - "createdAt" timestamp with time zone, - "updatedAt" timestamp with time zone, + "createdAt" timestamp with time zone default CURRENT_TIMESTAMP, + "updatedAt" timestamp with time zone default CURRENT_TIMESTAMP, "requestedById" int, "mediaId" int, constraint idx_194788_watchlist_pkey