Mohammed Anas
Mohammed Anas
Explore posts from servers
DTDrizzle Team
Created by Mohammed Anas on 8/9/2023 in #help
Error with drizzle-kit generate:pg
Update your tsconfig
7 replies
DTDrizzle Team
Created by Mohammed Anas on 9/28/2023 in #help
Drizzle kit schema migration with mysql ; Rerunning the entire schema
My drizzle config
import type { Config } from "drizzle-kit";
import dotenv from "dotenv";
dotenv.config({path:'.env.local'});
export default {
schema: "./db/schema.ts",
out: "./db/migrations/",
dbCredentials: {
connectionString: process.env["DATABASE_URL"]!,
},
driver: "mysql2",
strict: true,
} satisfies Config;
import type { Config } from "drizzle-kit";
import dotenv from "dotenv";
dotenv.config({path:'.env.local'});
export default {
schema: "./db/schema.ts",
out: "./db/migrations/",
dbCredentials: {
connectionString: process.env["DATABASE_URL"]!,
},
driver: "mysql2",
strict: true,
} satisfies Config;
3 replies
DTDrizzle Team
Created by Mohammed Anas on 9/28/2023 in #help
Drizzle kit schema migration with mysql ; Rerunning the entire schema
Only happens after the first migration , here is my schema for reference .
3 replies
DTDrizzle Team
Created by beneidel on 8/19/2023 in #help
only first db migration runs
17 replies
DTDrizzle Team
Created by beneidel on 8/19/2023 in #help
only first db migration runs
i've nt tried it but might work for you
17 replies
DTDrizzle Team
Created by beneidel on 8/19/2023 in #help
only first db migration runs
.
17 replies
DTDrizzle Team
Created by beneidel on 8/19/2023 in #help
only first db migration runs
one suggested to drop your drizzle version
17 replies
DTDrizzle Team
Created by beneidel on 8/19/2023 in #help
only first db migration runs
for dev i used to run my migrations manually on RDS sst console
17 replies
DTDrizzle Team
Created by beneidel on 8/19/2023 in #help
only first db migration runs
17 replies
DTDrizzle Team
Created by beneidel on 8/19/2023 in #help
only first db migration runs
it is a known bug
17 replies
DTDrizzle Team
Created by Suleman on 8/23/2023 in #help
I am getting typescript error when creating schema
if still get intellisense error,try reopening your text editor.
17 replies
DTDrizzle Team
Created by Suleman on 8/23/2023 in #help
I am getting typescript error when creating schema
this fixed it
17 replies
DTDrizzle Team
Created by Suleman on 8/23/2023 in #help
I am getting typescript error when creating schema
had the same issue
17 replies
DTDrizzle Team
Created by Suleman on 8/23/2023 in #help
I am getting typescript error when creating schema
in package.json
17 replies
DTDrizzle Team
Created by Suleman on 8/23/2023 in #help
I am getting typescript error when creating schema
if you use pnpm change ^0.28.2 -> 0.28.2
17 replies
DTDrizzle Team
Created by Suleman on 8/23/2023 in #help
I am getting typescript error when creating schema
probably pnpm cache
17 replies
DTDrizzle Team
Created by Mohammed Anas on 8/18/2023 in #help
How do i insert a Enum value into a table
DO $$ BEGIN
CREATE TYPE "role" AS ENUM('admin', 'maintainer');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
ALTER TABLE "userAuth" ADD COLUMN "role" "role" DEFAULT 'maintainer';

DO $$ BEGIN
CREATE TYPE "role" AS ENUM('admin', 'maintainer');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
ALTER TABLE "userAuth" ADD COLUMN "role" "role" DEFAULT 'maintainer';

14 replies
DTDrizzle Team
Created by Mohammed Anas on 8/18/2023 in #help
How do i insert a Enum value into a table
when i do
await db
.update(users)
.set({
role:"admin"
})
.where(eq(users.email, email));

await db
.update(users)
.set({
role:"admin"
})
.where(eq(users.email, email));

14 replies
DTDrizzle Team
Created by Mohammed Anas on 8/18/2023 in #help
How do i insert a Enum value into a table
I get this
BadRequestException: ERROR: column "role" is of type role but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
Position: 32; SQLState: 42804
BadRequestException: ERROR: column "role" is of type role but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
Position: 32; SQLState: 42804
14 replies
DTDrizzle Team
Created by Mohammed Anas on 8/18/2023 in #help
How do i insert a Enum value into a table
i even tried "admin"
14 replies