michi
michi
Explore posts from servers
DTDrizzle Team
Created by michi on 1/1/2025 in #help
[solved] drizzle-kit push fails when using with cockroachdb
I have simply used pnpx sv create . and then pasted in my connection string from cockroachdb to my .env and am trying to run drizzle-kit push as instructed.
> drizzle-kit push

drizzle-kit: v0.22.8
drizzle-orm: v0.33.0

No config path provided, using default path
Reading config file '/home/keogami/code/suchajoy/drizzle.config.ts'
Using 'postgres' driver for database querying
[✓] Pulling schema from database...

Warning You are about to execute current statements:

CREATE TABLE IF NOT EXISTS "session" (
"id" text PRIMARY KEY NOT NULL,
"user_id" text NOT NULL,
"expires_at" timestamp with time zone NOT NULL
);

CREATE TABLE IF NOT EXISTS "user" (
"id" text PRIMARY KEY NOT NULL,
"age" integer
);

DO $$ BEGIN
ALTER TABLE "session" ADD CONSTRAINT "session_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;


PostgresError: at or near "do": syntax error
at ErrorResponse (/home/keogami/code/suchajoy/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:79677:27)
at handle (/home/keogami/code/suchajoy/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:79454:7)
at TLSSocket.data (/home/keogami/code/suchajoy/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:79277:9)
at TLSSocket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:189:23)
at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
severity_local: 'ERROR',
severity: 'ERROR',
code: '42601',
detail: 'source SQL:\nDO $$ BEGIN\n^',
file: 'lexer.go',
line: '399',
routine: 'Error'
}
> drizzle-kit push

drizzle-kit: v0.22.8
drizzle-orm: v0.33.0

No config path provided, using default path
Reading config file '/home/keogami/code/suchajoy/drizzle.config.ts'
Using 'postgres' driver for database querying
[✓] Pulling schema from database...

Warning You are about to execute current statements:

CREATE TABLE IF NOT EXISTS "session" (
"id" text PRIMARY KEY NOT NULL,
"user_id" text NOT NULL,
"expires_at" timestamp with time zone NOT NULL
);

CREATE TABLE IF NOT EXISTS "user" (
"id" text PRIMARY KEY NOT NULL,
"age" integer
);

DO $$ BEGIN
ALTER TABLE "session" ADD CONSTRAINT "session_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;


PostgresError: at or near "do": syntax error
at ErrorResponse (/home/keogami/code/suchajoy/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:79677:27)
at handle (/home/keogami/code/suchajoy/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:79454:7)
at TLSSocket.data (/home/keogami/code/suchajoy/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:79277:9)
at TLSSocket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:189:23)
at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
severity_local: 'ERROR',
severity: 'ERROR',
code: '42601',
detail: 'source SQL:\nDO $$ BEGIN\n^',
file: 'lexer.go',
line: '399',
routine: 'Error'
}
2 replies
CCConvex Community
Created by michi on 9/11/2024 in #support-community
Common patterns for migration and data seeding
Hello, i am new to convex and wanted to learn how i can go from development to deploying to production with convex. What are the some common ways you guys perform migrations and data seeding. for example, seeding the admin account details when setting up the application for the first time. or, changing moving out a field from one table to another table after the app has hit production?
8 replies