CREATE TABLE `chemistries` (
	`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
	`name` text NOT NULL,
	`is_custom` integer DEFAULT false,
	`created_at` text DEFAULT (datetime('now'))
);
--> statement-breakpoint
CREATE UNIQUE INDEX `chemistries_name_unique` ON `chemistries` (`name`);--> statement-breakpoint
DROP INDEX `brand_type_idx`;--> statement-breakpoint
ALTER TABLE `battery_groups` ADD `chemistry_id` integer NOT NULL REFERENCES chemistries(id);--> statement-breakpoint
CREATE UNIQUE INDEX `brand_type_chemistry_idx` ON `battery_groups` (`brand_id`,`type_id`,`chemistry_id`);