boba
boba
DTDrizzle Team
Created by boba on 9/11/2024 in #help
migration problem
Is there a reason why its giving me a bad request when i use the migrate command?
16 replies
DTDrizzle Team
Created by boba on 9/11/2024 in #help
migration problem
Any1
16 replies
DTDrizzle Team
Created by boba on 9/11/2024 in #help
migration problem
heres my config file
import 'dotenv/config'
import type { Config } from 'drizzle-kit'

export default {
schema: './db/schema.ts',
out: './migrations',
driver: 'turso',
dbCredentials: {
url: process.env.TURSO_CONNECTION_URL!,
authToken: process.env.TURSO_AUTH_TOKEN!,
},
verbose: true,
strict: true,
dialect: 'sqlite',
} satisfies Config
import 'dotenv/config'
import type { Config } from 'drizzle-kit'

export default {
schema: './db/schema.ts',
out: './migrations',
driver: 'turso',
dbCredentials: {
url: process.env.TURSO_CONNECTION_URL!,
authToken: process.env.TURSO_AUTH_TOKEN!,
},
verbose: true,
strict: true,
dialect: 'sqlite',
} satisfies Config
16 replies
DTDrizzle Team
Created by boba on 9/11/2024 in #help
migration problem
i followed but i keep getting this
[⣷] applying migrations...result: Response {
status: 400,
statusText: 'Bad Request',
headers: Headers {
'access-control-allow-origin': '*',
'content-type': 'application/json',
date: 'Fri, 13 Sep 2024 08:01:19 GMT',
'fly-request-id': '01J7N6D7H4AY9SA9YARQ4H1PR8-sjc',
server: 'Fly/0049c9a9 (2024-09-10)',
'server-timing': 'query_total;dur=258.371µs,',
vary: 'origin, access-control-request-method, access-control-request-headers',
via: '2 fly.io, 1.1 fly.io',
'transfer-encoding': 'chunked',
'content-encoding': 'br'
},
body: ReadableStream { locked: false, state: 'readable', supportsBYOB: true },
bodyUsed: false,
ok: false,
redirected: false,
type: 'basic',
url: 'https://linksharing-safepre.turso.io/v1/jobs'
}
[⣷] applying migrations...result: Response {
status: 400,
statusText: 'Bad Request',
headers: Headers {
'access-control-allow-origin': '*',
'content-type': 'application/json',
date: 'Fri, 13 Sep 2024 08:01:19 GMT',
'fly-request-id': '01J7N6D7H4AY9SA9YARQ4H1PR8-sjc',
server: 'Fly/0049c9a9 (2024-09-10)',
'server-timing': 'query_total;dur=258.371µs,',
vary: 'origin, access-control-request-method, access-control-request-headers',
via: '2 fly.io, 1.1 fly.io',
'transfer-encoding': 'chunked',
'content-encoding': 'br'
},
body: ReadableStream { locked: false, state: 'readable', supportsBYOB: true },
bodyUsed: false,
ok: false,
redirected: false,
type: 'basic',
url: 'https://linksharing-safepre.turso.io/v1/jobs'
}
16 replies
DTDrizzle Team
Created by boba on 9/11/2024 in #help
migration problem
hey
16 replies
DTDrizzle Team
Created by boba on 9/11/2024 in #help
migration problem
huh
16 replies
DTDrizzle Team
Created by boba on 9/11/2024 in #help
migration problem
I don't think dropping the tables would be nice
16 replies
DTDrizzle Team
Created by boba on 9/11/2024 in #help
migration problem
That should work but what if I want to make changes just by simply adding another column into my table for example I added a presignedurl col
16 replies
DTDrizzle Team
Created by boba on 9/11/2024 in #help
migration problem
Anyone?
16 replies
DTDrizzle Team
Created by boba on 9/11/2024 in #help
migration problem
here is the migration file
CREATE TABLE `platforms` (
`id` text PRIMARY KEY NOT NULL,
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
`profile_id` text,
`name` text NOT NULL,
`link` text NOT NULL,
FOREIGN KEY (`profile_id`) REFERENCES `profiles`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `profiles` (
`id` text PRIMARY KEY NOT NULL,
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
`user_id` text,
`email` text NOT NULL,
`first_name` text NOT NULL,
`last_name` text NOT NULL,
`presigned_url` text,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `users` (
`id` text PRIMARY KEY NOT NULL,
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
`email` text NOT NULL,
`password` text NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `profiles_user_id_unique` ON `profiles` (`user_id`);--> statement-breakpoint
CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);
CREATE TABLE `platforms` (
`id` text PRIMARY KEY NOT NULL,
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
`profile_id` text,
`name` text NOT NULL,
`link` text NOT NULL,
FOREIGN KEY (`profile_id`) REFERENCES `profiles`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `profiles` (
`id` text PRIMARY KEY NOT NULL,
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
`user_id` text,
`email` text NOT NULL,
`first_name` text NOT NULL,
`last_name` text NOT NULL,
`presigned_url` text,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `users` (
`id` text PRIMARY KEY NOT NULL,
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
`email` text NOT NULL,
`password` text NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `profiles_user_id_unique` ON `profiles` (`user_id`);--> statement-breakpoint
CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);
16 replies