CREATE TABLE `character_abilities` (
	`character` integer NOT NULL,
	`ability` text NOT NULL,
	`value` integer DEFAULT 0 NOT NULL,
	PRIMARY KEY(`character`, `ability`),
	FOREIGN KEY (`character`) REFERENCES `character`(`id`) ON UPDATE cascade ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `character_leveling` (
	`character` integer NOT NULL,
	`level` integer NOT NULL,
	`choice` integer NOT NULL,
	PRIMARY KEY(`character`, `level`),
	FOREIGN KEY (`character`) REFERENCES `character`(`id`) ON UPDATE cascade ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `character_modifiers` (
	`character` integer NOT NULL,
	`modifier` text NOT NULL,
	`value` integer DEFAULT 0 NOT NULL,
	PRIMARY KEY(`character`, `modifier`),
	FOREIGN KEY (`character`) REFERENCES `character`(`id`) ON UPDATE cascade ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `character_spell` (
	`character` integer PRIMARY KEY NOT NULL,
	`value` text NOT NULL,
	FOREIGN KEY (`character`) REFERENCES `character`(`id`) ON UPDATE cascade ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `character_training` (
	`character` integer NOT NULL,
	`stat` text NOT NULL,
	`level` integer NOT NULL,
	`choice` integer NOT NULL,
	PRIMARY KEY(`character`, `stat`, `level`),
	FOREIGN KEY (`character`) REFERENCES `character`(`id`) ON UPDATE cascade ON DELETE cascade
);
--> statement-breakpoint
ALTER TABLE `character` ADD `people` integer NOT NULL;--> statement-breakpoint
ALTER TABLE `character` ADD `level` integer DEFAULT 1 NOT NULL;--> statement-breakpoint
ALTER TABLE `character` ADD `aspect` integer;--> statement-breakpoint
ALTER TABLE `character` ADD `notes` text;--> statement-breakpoint
ALTER TABLE `character` ADD `health` integer DEFAULT 0 NOT NULL;--> statement-breakpoint
ALTER TABLE `character` ADD `mana` integer DEFAULT 0 NOT NULL;--> statement-breakpoint
ALTER TABLE `character` DROP COLUMN `progress`;--> statement-breakpoint
ALTER TABLE `character` DROP COLUMN `values`;