Isak
Isak
Explore posts from servers
DTDrizzle Team
Created by Isak on 3/25/2024 in #help
Running drizzle-kit push:sqlite with Turso
So it seems like drizzle did not generate correct sql (from my knowledge). I ended up writing this to insert data only into the columns that existed before
ALTER TABLE `isak.dev_burger` RENAME TO `isak.dev_burger_old`;--> statement-breakpoint

CREATE TABLE `isak.dev_burger` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`resturant_name` text(256),
`created_at` integer DEFAULT CURRENT_TIMESTAMP,
`updatedAt` integer,
`rating` integer,
`description` text,
`city` text,
`country` text(256),
`tested_food` text,
`images` text,
`address` text DEFAULT 'empty address'
);--> statement-breakpoint

INSERT INTO `isak.dev_burger` (id,
resturant_name,
created_at,
updatedAt,
rating,
description,
city,
country,
tested_food,
images)
SELECT * FROM `isak.dev_burger_old`;--> statement-breakpoint

DROP TABLE `isak.dev_burger_old`;--> statement-breakpoint
ALTER TABLE `isak.dev_burger` RENAME TO `isak.dev_burger_old`;--> statement-breakpoint

CREATE TABLE `isak.dev_burger` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`resturant_name` text(256),
`created_at` integer DEFAULT CURRENT_TIMESTAMP,
`updatedAt` integer,
`rating` integer,
`description` text,
`city` text,
`country` text(256),
`tested_food` text,
`images` text,
`address` text DEFAULT 'empty address'
);--> statement-breakpoint

INSERT INTO `isak.dev_burger` (id,
resturant_name,
created_at,
updatedAt,
rating,
description,
city,
country,
tested_food,
images)
SELECT * FROM `isak.dev_burger_old`;--> statement-breakpoint

DROP TABLE `isak.dev_burger_old`;--> statement-breakpoint
3 replies