-
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.
- Loading branch information
Showing
5 changed files
with
13 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
ALTER TABLE "wave" ADD COLUMN "summary" text NOT NULL; | ||
ALTER TABLE "wave" ADD COLUMN "openStartDate" timestamp with time zone NOT NULL; | ||
ALTER TABLE "wave" ADD COLUMN "denoisingStartDate" timestamp with time zone NOT NULL; | ||
ALTER TABLE "wave" ADD COLUMN "assesmentStartDate" timestamp with time zone NOT NULL; | ||
ALTER TABLE "wave" ADD COLUMN "closeDate" timestamp with time zone NOT NULL; | ||
ALTER TABLE "wave" ADD COLUMN IF NOT EXISTS "summary" text NOT NULL; | ||
ALTER TABLE "wave" ADD COLUMN IF NOT EXISTS "openStartDate" timestamp with time zone NOT NULL; | ||
ALTER TABLE "wave" ADD COLUMN IF NOT EXISTS "denoisingStartDate" timestamp with time zone NOT NULL; | ||
ALTER TABLE "wave" ADD COLUMN IF NOT EXISTS "assesmentStartDate" timestamp with time zone NOT NULL; | ||
ALTER TABLE "wave" ADD COLUMN IF NOT EXISTS "closeDate" timestamp with time zone NOT NULL; | ||
ALTER TABLE "wave" DROP COLUMN IF EXISTS "startsAt"; | ||
ALTER TABLE "wave" DROP COLUMN IF EXISTS "endsAt"; |
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,5 +1,5 @@ | ||
DROP TABLE "account"; | ||
DROP TABLE "session"; | ||
DROP TABLE "verificationToken"; | ||
DROP TABLE IF EXISTS "account"; | ||
DROP TABLE IF EXISTS "session"; | ||
DROP TABLE IF EXISTS "verificationToken"; | ||
ALTER TABLE "user" DROP COLUMN IF EXISTS "email"; | ||
ALTER TABLE "user" DROP COLUMN IF EXISTS "emailVerified"; |
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 |
---|---|---|
@@ -1,28 +1,13 @@ | ||
import { db } from "@/drizzle/db"; | ||
import { Account, Session, User } from "@/drizzle/schema"; | ||
|
||
import { addDays } from "@/lib/dates"; | ||
import { User } from "@/drizzle/schema"; | ||
|
||
async function globalSetup() { | ||
await db.delete(User); | ||
|
||
const [{ userId }] = await db | ||
await db | ||
.insert(User) | ||
.values({ id: "regularUserId", email: "[email protected]" }) | ||
.values({ id: "regularUserId" }) | ||
.returning({ userId: User.id }); | ||
|
||
await db.insert(Session).values({ | ||
userId, | ||
sessionToken: "regularUserSession", | ||
expires: addDays(new Date(), 180), | ||
}); | ||
|
||
await db.insert(Account).values({ | ||
userId, | ||
provider: "mock", | ||
providerAccountId: "mockId", | ||
type: "email", | ||
}); | ||
} | ||
|
||
export default globalSetup; |
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