Add Turso/Vercel deployment configuration

- Updated database connection to support Turso auth token
- Added vercel.json with bun build configuration
- Updated environment schema for production deployment
- Added new features and components for production readiness
This commit is contained in:
2025-07-12 01:42:43 -04:00
parent 2d217fab47
commit a1b40e7a9c
75 changed files with 8821 additions and 1803 deletions

View File

@@ -0,0 +1,2 @@
ALTER TABLE `beenvoice_invoice_item` ADD COLUMN `position` integer DEFAULT 0 NOT NULL;
CREATE INDEX `invoice_item_position_idx` ON `beenvoice_invoice_item` (`position`);

125
drizzle/0000_unique_loa.sql Normal file
View File

@@ -0,0 +1,125 @@
CREATE TABLE `beenvoice_account` (
`userId` text(255) NOT NULL,
`type` text(255) NOT NULL,
`provider` text(255) NOT NULL,
`providerAccountId` text(255) NOT NULL,
`refresh_token` text,
`access_token` text,
`expires_at` integer,
`token_type` text(255),
`scope` text(255),
`id_token` text,
`session_state` text(255),
PRIMARY KEY(`provider`, `providerAccountId`),
FOREIGN KEY (`userId`) REFERENCES `beenvoice_user`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE INDEX `account_user_id_idx` ON `beenvoice_account` (`userId`);--> statement-breakpoint
CREATE TABLE `beenvoice_business` (
`id` text(255) PRIMARY KEY NOT NULL,
`name` text(255) NOT NULL,
`email` text(255),
`phone` text(50),
`addressLine1` text(255),
`addressLine2` text(255),
`city` text(100),
`state` text(50),
`postalCode` text(20),
`country` text(100),
`website` text(255),
`taxId` text(100),
`logoUrl` text(500),
`isDefault` integer DEFAULT false,
`createdById` text(255) NOT NULL,
`createdAt` integer DEFAULT (unixepoch()) NOT NULL,
`updatedAt` integer,
FOREIGN KEY (`createdById`) REFERENCES `beenvoice_user`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE INDEX `business_created_by_idx` ON `beenvoice_business` (`createdById`);--> statement-breakpoint
CREATE INDEX `business_name_idx` ON `beenvoice_business` (`name`);--> statement-breakpoint
CREATE INDEX `business_email_idx` ON `beenvoice_business` (`email`);--> statement-breakpoint
CREATE INDEX `business_is_default_idx` ON `beenvoice_business` (`isDefault`);--> statement-breakpoint
CREATE TABLE `beenvoice_client` (
`id` text(255) PRIMARY KEY NOT NULL,
`name` text(255) NOT NULL,
`email` text(255),
`phone` text(50),
`addressLine1` text(255),
`addressLine2` text(255),
`city` text(100),
`state` text(50),
`postalCode` text(20),
`country` text(100),
`createdById` text(255) NOT NULL,
`createdAt` integer DEFAULT (unixepoch()) NOT NULL,
`updatedAt` integer,
FOREIGN KEY (`createdById`) REFERENCES `beenvoice_user`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE INDEX `client_created_by_idx` ON `beenvoice_client` (`createdById`);--> statement-breakpoint
CREATE INDEX `client_name_idx` ON `beenvoice_client` (`name`);--> statement-breakpoint
CREATE INDEX `client_email_idx` ON `beenvoice_client` (`email`);--> statement-breakpoint
CREATE TABLE `beenvoice_invoice_item` (
`id` text(255) PRIMARY KEY NOT NULL,
`invoiceId` text(255) NOT NULL,
`date` integer NOT NULL,
`description` text(500) NOT NULL,
`hours` real NOT NULL,
`rate` real NOT NULL,
`amount` real NOT NULL,
`position` integer DEFAULT 0 NOT NULL,
`createdAt` integer DEFAULT (unixepoch()) NOT NULL,
FOREIGN KEY (`invoiceId`) REFERENCES `beenvoice_invoice`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE INDEX `invoice_item_invoice_id_idx` ON `beenvoice_invoice_item` (`invoiceId`);--> statement-breakpoint
CREATE INDEX `invoice_item_date_idx` ON `beenvoice_invoice_item` (`date`);--> statement-breakpoint
CREATE INDEX `invoice_item_position_idx` ON `beenvoice_invoice_item` (`position`);--> statement-breakpoint
CREATE TABLE `beenvoice_invoice` (
`id` text(255) PRIMARY KEY NOT NULL,
`invoiceNumber` text(100) NOT NULL,
`businessId` text(255),
`clientId` text(255) NOT NULL,
`issueDate` integer NOT NULL,
`dueDate` integer NOT NULL,
`status` text(50) DEFAULT 'draft' NOT NULL,
`totalAmount` real DEFAULT 0 NOT NULL,
`taxRate` real DEFAULT 0 NOT NULL,
`notes` text(1000),
`createdById` text(255) NOT NULL,
`createdAt` integer DEFAULT (unixepoch()) NOT NULL,
`updatedAt` integer,
FOREIGN KEY (`businessId`) REFERENCES `beenvoice_business`(`id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`clientId`) REFERENCES `beenvoice_client`(`id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`createdById`) REFERENCES `beenvoice_user`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE INDEX `invoice_business_id_idx` ON `beenvoice_invoice` (`businessId`);--> statement-breakpoint
CREATE INDEX `invoice_client_id_idx` ON `beenvoice_invoice` (`clientId`);--> statement-breakpoint
CREATE INDEX `invoice_created_by_idx` ON `beenvoice_invoice` (`createdById`);--> statement-breakpoint
CREATE INDEX `invoice_number_idx` ON `beenvoice_invoice` (`invoiceNumber`);--> statement-breakpoint
CREATE INDEX `invoice_status_idx` ON `beenvoice_invoice` (`status`);--> statement-breakpoint
CREATE TABLE `beenvoice_session` (
`sessionToken` text(255) PRIMARY KEY NOT NULL,
`userId` text(255) NOT NULL,
`expires` integer NOT NULL,
FOREIGN KEY (`userId`) REFERENCES `beenvoice_user`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE INDEX `session_userId_idx` ON `beenvoice_session` (`userId`);--> statement-breakpoint
CREATE TABLE `beenvoice_user` (
`id` text(255) PRIMARY KEY NOT NULL,
`name` text(255),
`email` text(255) NOT NULL,
`password` text(255),
`emailVerified` integer DEFAULT (unixepoch()),
`image` text(255)
);
--> statement-breakpoint
CREATE TABLE `beenvoice_verification_token` (
`identifier` text(255) NOT NULL,
`token` text(255) NOT NULL,
`expires` integer NOT NULL,
PRIMARY KEY(`identifier`, `token`)
);

View File

@@ -0,0 +1,2 @@
ALTER TABLE `beenvoice_invoice` ADD COLUMN `taxRate` real NOT NULL DEFAULT 0;
UPDATE `beenvoice_invoice` SET `taxRate` = 0 WHERE `taxRate` IS NULL;

View File

@@ -0,0 +1,29 @@
PRAGMA foreign_keys=OFF;--> statement-breakpoint
CREATE TABLE `__new_beenvoice_invoice` (
`id` text(255) PRIMARY KEY NOT NULL,
`invoiceNumber` text(100) NOT NULL,
`businessId` text(255),
`clientId` text(255) NOT NULL,
`issueDate` integer NOT NULL,
`dueDate` integer NOT NULL,
`status` text(50) DEFAULT 'draft' NOT NULL,
`totalAmount` real DEFAULT 0 NOT NULL,
`taxRate` real DEFAULT 0 NOT NULL,
`notes` text(1000),
`createdById` text(255) NOT NULL,
`createdAt` integer DEFAULT (unixepoch()) NOT NULL,
`updatedAt` integer,
FOREIGN KEY (`businessId`) REFERENCES `beenvoice_business`(`id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`clientId`) REFERENCES `beenvoice_client`(`id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`createdById`) REFERENCES `beenvoice_user`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
INSERT INTO `__new_beenvoice_invoice`("id", "invoiceNumber", "businessId", "clientId", "issueDate", "dueDate", "status", "totalAmount", "taxRate", "notes", "createdById", "createdAt", "updatedAt") SELECT "id", "invoiceNumber", "businessId", "clientId", "issueDate", "dueDate", "status", "totalAmount", "taxRate", "notes", "createdById", "createdAt", "updatedAt" FROM `beenvoice_invoice`;--> statement-breakpoint
DROP TABLE `beenvoice_invoice`;--> statement-breakpoint
ALTER TABLE `__new_beenvoice_invoice` RENAME TO `beenvoice_invoice`;--> statement-breakpoint
PRAGMA foreign_keys=ON;--> statement-breakpoint
CREATE INDEX `invoice_business_id_idx` ON `beenvoice_invoice` (`businessId`);--> statement-breakpoint
CREATE INDEX `invoice_client_id_idx` ON `beenvoice_invoice` (`clientId`);--> statement-breakpoint
CREATE INDEX `invoice_created_by_idx` ON `beenvoice_invoice` (`createdById`);--> statement-breakpoint
CREATE INDEX `invoice_number_idx` ON `beenvoice_invoice` (`invoiceNumber`);--> statement-breakpoint
CREATE INDEX `invoice_status_idx` ON `beenvoice_invoice` (`status`);

View File

@@ -0,0 +1,884 @@
{
"version": "6",
"dialect": "sqlite",
"id": "d29d5fc3-5c1a-4506-b057-2c117bcd2017",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"beenvoice_account": {
"name": "beenvoice_account",
"columns": {
"userId": {
"name": "userId",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"provider": {
"name": "provider",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"providerAccountId": {
"name": "providerAccountId",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"refresh_token": {
"name": "refresh_token",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"access_token": {
"name": "access_token",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"expires_at": {
"name": "expires_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"token_type": {
"name": "token_type",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"scope": {
"name": "scope",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"id_token": {
"name": "id_token",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"session_state": {
"name": "session_state",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {
"account_user_id_idx": {
"name": "account_user_id_idx",
"columns": [
"userId"
],
"isUnique": false
}
},
"foreignKeys": {
"beenvoice_account_userId_beenvoice_user_id_fk": {
"name": "beenvoice_account_userId_beenvoice_user_id_fk",
"tableFrom": "beenvoice_account",
"tableTo": "beenvoice_user",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {
"beenvoice_account_provider_providerAccountId_pk": {
"columns": [
"provider",
"providerAccountId"
],
"name": "beenvoice_account_provider_providerAccountId_pk"
}
},
"uniqueConstraints": {},
"checkConstraints": {}
},
"beenvoice_business": {
"name": "beenvoice_business",
"columns": {
"id": {
"name": "id",
"type": "text(255)",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"email": {
"name": "email",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"phone": {
"name": "phone",
"type": "text(50)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"addressLine1": {
"name": "addressLine1",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"addressLine2": {
"name": "addressLine2",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"city": {
"name": "city",
"type": "text(100)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"state": {
"name": "state",
"type": "text(50)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"postalCode": {
"name": "postalCode",
"type": "text(20)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"country": {
"name": "country",
"type": "text(100)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"website": {
"name": "website",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"taxId": {
"name": "taxId",
"type": "text(100)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"logoUrl": {
"name": "logoUrl",
"type": "text(500)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"isDefault": {
"name": "isDefault",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": false
},
"createdById": {
"name": "createdById",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"createdAt": {
"name": "createdAt",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(unixepoch())"
},
"updatedAt": {
"name": "updatedAt",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {
"business_created_by_idx": {
"name": "business_created_by_idx",
"columns": [
"createdById"
],
"isUnique": false
},
"business_name_idx": {
"name": "business_name_idx",
"columns": [
"name"
],
"isUnique": false
},
"business_email_idx": {
"name": "business_email_idx",
"columns": [
"email"
],
"isUnique": false
},
"business_is_default_idx": {
"name": "business_is_default_idx",
"columns": [
"isDefault"
],
"isUnique": false
}
},
"foreignKeys": {
"beenvoice_business_createdById_beenvoice_user_id_fk": {
"name": "beenvoice_business_createdById_beenvoice_user_id_fk",
"tableFrom": "beenvoice_business",
"tableTo": "beenvoice_user",
"columnsFrom": [
"createdById"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"beenvoice_client": {
"name": "beenvoice_client",
"columns": {
"id": {
"name": "id",
"type": "text(255)",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"email": {
"name": "email",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"phone": {
"name": "phone",
"type": "text(50)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"addressLine1": {
"name": "addressLine1",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"addressLine2": {
"name": "addressLine2",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"city": {
"name": "city",
"type": "text(100)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"state": {
"name": "state",
"type": "text(50)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"postalCode": {
"name": "postalCode",
"type": "text(20)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"country": {
"name": "country",
"type": "text(100)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"createdById": {
"name": "createdById",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"createdAt": {
"name": "createdAt",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(unixepoch())"
},
"updatedAt": {
"name": "updatedAt",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {
"client_created_by_idx": {
"name": "client_created_by_idx",
"columns": [
"createdById"
],
"isUnique": false
},
"client_name_idx": {
"name": "client_name_idx",
"columns": [
"name"
],
"isUnique": false
},
"client_email_idx": {
"name": "client_email_idx",
"columns": [
"email"
],
"isUnique": false
}
},
"foreignKeys": {
"beenvoice_client_createdById_beenvoice_user_id_fk": {
"name": "beenvoice_client_createdById_beenvoice_user_id_fk",
"tableFrom": "beenvoice_client",
"tableTo": "beenvoice_user",
"columnsFrom": [
"createdById"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"beenvoice_invoice_item": {
"name": "beenvoice_invoice_item",
"columns": {
"id": {
"name": "id",
"type": "text(255)",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"invoiceId": {
"name": "invoiceId",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"date": {
"name": "date",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"description": {
"name": "description",
"type": "text(500)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"hours": {
"name": "hours",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"rate": {
"name": "rate",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"amount": {
"name": "amount",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"position": {
"name": "position",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"createdAt": {
"name": "createdAt",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(unixepoch())"
}
},
"indexes": {
"invoice_item_invoice_id_idx": {
"name": "invoice_item_invoice_id_idx",
"columns": [
"invoiceId"
],
"isUnique": false
},
"invoice_item_date_idx": {
"name": "invoice_item_date_idx",
"columns": [
"date"
],
"isUnique": false
},
"invoice_item_position_idx": {
"name": "invoice_item_position_idx",
"columns": [
"position"
],
"isUnique": false
}
},
"foreignKeys": {
"beenvoice_invoice_item_invoiceId_beenvoice_invoice_id_fk": {
"name": "beenvoice_invoice_item_invoiceId_beenvoice_invoice_id_fk",
"tableFrom": "beenvoice_invoice_item",
"tableTo": "beenvoice_invoice",
"columnsFrom": [
"invoiceId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"beenvoice_invoice": {
"name": "beenvoice_invoice",
"columns": {
"id": {
"name": "id",
"type": "text(255)",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"invoiceNumber": {
"name": "invoiceNumber",
"type": "text(100)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"businessId": {
"name": "businessId",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"clientId": {
"name": "clientId",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"issueDate": {
"name": "issueDate",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"dueDate": {
"name": "dueDate",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text(50)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'draft'"
},
"totalAmount": {
"name": "totalAmount",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"taxRate": {
"name": "taxRate",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"notes": {
"name": "notes",
"type": "text(1000)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"createdById": {
"name": "createdById",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"createdAt": {
"name": "createdAt",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(unixepoch())"
},
"updatedAt": {
"name": "updatedAt",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {
"invoice_business_id_idx": {
"name": "invoice_business_id_idx",
"columns": [
"businessId"
],
"isUnique": false
},
"invoice_client_id_idx": {
"name": "invoice_client_id_idx",
"columns": [
"clientId"
],
"isUnique": false
},
"invoice_created_by_idx": {
"name": "invoice_created_by_idx",
"columns": [
"createdById"
],
"isUnique": false
},
"invoice_number_idx": {
"name": "invoice_number_idx",
"columns": [
"invoiceNumber"
],
"isUnique": false
},
"invoice_status_idx": {
"name": "invoice_status_idx",
"columns": [
"status"
],
"isUnique": false
}
},
"foreignKeys": {
"beenvoice_invoice_businessId_beenvoice_business_id_fk": {
"name": "beenvoice_invoice_businessId_beenvoice_business_id_fk",
"tableFrom": "beenvoice_invoice",
"tableTo": "beenvoice_business",
"columnsFrom": [
"businessId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"beenvoice_invoice_clientId_beenvoice_client_id_fk": {
"name": "beenvoice_invoice_clientId_beenvoice_client_id_fk",
"tableFrom": "beenvoice_invoice",
"tableTo": "beenvoice_client",
"columnsFrom": [
"clientId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"beenvoice_invoice_createdById_beenvoice_user_id_fk": {
"name": "beenvoice_invoice_createdById_beenvoice_user_id_fk",
"tableFrom": "beenvoice_invoice",
"tableTo": "beenvoice_user",
"columnsFrom": [
"createdById"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"beenvoice_session": {
"name": "beenvoice_session",
"columns": {
"sessionToken": {
"name": "sessionToken",
"type": "text(255)",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"userId": {
"name": "userId",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"expires": {
"name": "expires",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"session_userId_idx": {
"name": "session_userId_idx",
"columns": [
"userId"
],
"isUnique": false
}
},
"foreignKeys": {
"beenvoice_session_userId_beenvoice_user_id_fk": {
"name": "beenvoice_session_userId_beenvoice_user_id_fk",
"tableFrom": "beenvoice_session",
"tableTo": "beenvoice_user",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"beenvoice_user": {
"name": "beenvoice_user",
"columns": {
"id": {
"name": "id",
"type": "text(255)",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"email": {
"name": "email",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"password": {
"name": "password",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"emailVerified": {
"name": "emailVerified",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": "(unixepoch())"
},
"image": {
"name": "image",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"beenvoice_verification_token": {
"name": "beenvoice_verification_token",
"columns": {
"identifier": {
"name": "identifier",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"token": {
"name": "token",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"expires": {
"name": "expires",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"beenvoice_verification_token_identifier_token_pk": {
"columns": [
"identifier",
"token"
],
"name": "beenvoice_verification_token_identifier_token_pk"
}
},
"uniqueConstraints": {},
"checkConstraints": {}
}
},
"views": {},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}

View File

@@ -0,0 +1,683 @@
{
"version": "6",
"dialect": "sqlite",
"id": "5672a328-2801-45d8-9e27-bb9fe07e6c0e",
"prevId": "4d0fc78f-75b4-4059-b7f0-1aa656f007b7",
"tables": {
"beenvoice_account": {
"name": "beenvoice_account",
"columns": {
"userId": {
"name": "userId",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"provider": {
"name": "provider",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"providerAccountId": {
"name": "providerAccountId",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"refresh_token": {
"name": "refresh_token",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"access_token": {
"name": "access_token",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"expires_at": {
"name": "expires_at",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"token_type": {
"name": "token_type",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"scope": {
"name": "scope",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"id_token": {
"name": "id_token",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"session_state": {
"name": "session_state",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {
"account_user_id_idx": {
"name": "account_user_id_idx",
"columns": [
"userId"
],
"isUnique": false
}
},
"foreignKeys": {
"beenvoice_account_userId_beenvoice_user_id_fk": {
"name": "beenvoice_account_userId_beenvoice_user_id_fk",
"tableFrom": "beenvoice_account",
"tableTo": "beenvoice_user",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {
"beenvoice_account_provider_providerAccountId_pk": {
"columns": [
"provider",
"providerAccountId"
],
"name": "beenvoice_account_provider_providerAccountId_pk"
}
},
"uniqueConstraints": {},
"checkConstraints": {}
},
"beenvoice_client": {
"name": "beenvoice_client",
"columns": {
"id": {
"name": "id",
"type": "text(255)",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"email": {
"name": "email",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"phone": {
"name": "phone",
"type": "text(50)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"addressLine1": {
"name": "addressLine1",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"addressLine2": {
"name": "addressLine2",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"city": {
"name": "city",
"type": "text(100)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"state": {
"name": "state",
"type": "text(50)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"postalCode": {
"name": "postalCode",
"type": "text(20)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"country": {
"name": "country",
"type": "text(100)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"createdById": {
"name": "createdById",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"createdAt": {
"name": "createdAt",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(unixepoch())"
},
"updatedAt": {
"name": "updatedAt",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {
"client_created_by_idx": {
"name": "client_created_by_idx",
"columns": [
"createdById"
],
"isUnique": false
},
"client_name_idx": {
"name": "client_name_idx",
"columns": [
"name"
],
"isUnique": false
},
"client_email_idx": {
"name": "client_email_idx",
"columns": [
"email"
],
"isUnique": false
}
},
"foreignKeys": {
"beenvoice_client_createdById_beenvoice_user_id_fk": {
"name": "beenvoice_client_createdById_beenvoice_user_id_fk",
"tableFrom": "beenvoice_client",
"tableTo": "beenvoice_user",
"columnsFrom": [
"createdById"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"beenvoice_invoice_item": {
"name": "beenvoice_invoice_item",
"columns": {
"id": {
"name": "id",
"type": "text(255)",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"invoiceId": {
"name": "invoiceId",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"date": {
"name": "date",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"description": {
"name": "description",
"type": "text(500)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"hours": {
"name": "hours",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"rate": {
"name": "rate",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"amount": {
"name": "amount",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"position": {
"name": "position",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"createdAt": {
"name": "createdAt",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(unixepoch())"
}
},
"indexes": {
"invoice_item_invoice_id_idx": {
"name": "invoice_item_invoice_id_idx",
"columns": [
"invoiceId"
],
"isUnique": false
},
"invoice_item_date_idx": {
"name": "invoice_item_date_idx",
"columns": [
"date"
],
"isUnique": false
},
"invoice_item_position_idx": {
"name": "invoice_item_position_idx",
"columns": [
"position"
],
"isUnique": false
}
},
"foreignKeys": {
"beenvoice_invoice_item_invoiceId_beenvoice_invoice_id_fk": {
"name": "beenvoice_invoice_item_invoiceId_beenvoice_invoice_id_fk",
"tableFrom": "beenvoice_invoice_item",
"tableTo": "beenvoice_invoice",
"columnsFrom": [
"invoiceId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"beenvoice_invoice": {
"name": "beenvoice_invoice",
"columns": {
"id": {
"name": "id",
"type": "text(255)",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"invoiceNumber": {
"name": "invoiceNumber",
"type": "text(100)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"clientId": {
"name": "clientId",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"issueDate": {
"name": "issueDate",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"dueDate": {
"name": "dueDate",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text(50)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'draft'"
},
"totalAmount": {
"name": "totalAmount",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"taxRate": {
"name": "taxRate",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"notes": {
"name": "notes",
"type": "text(1000)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"createdById": {
"name": "createdById",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"createdAt": {
"name": "createdAt",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(unixepoch())"
},
"updatedAt": {
"name": "updatedAt",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {
"invoice_client_id_idx": {
"name": "invoice_client_id_idx",
"columns": [
"clientId"
],
"isUnique": false
},
"invoice_created_by_idx": {
"name": "invoice_created_by_idx",
"columns": [
"createdById"
],
"isUnique": false
},
"invoice_number_idx": {
"name": "invoice_number_idx",
"columns": [
"invoiceNumber"
],
"isUnique": false
},
"invoice_status_idx": {
"name": "invoice_status_idx",
"columns": [
"status"
],
"isUnique": false
}
},
"foreignKeys": {
"beenvoice_invoice_clientId_beenvoice_client_id_fk": {
"name": "beenvoice_invoice_clientId_beenvoice_client_id_fk",
"tableFrom": "beenvoice_invoice",
"tableTo": "beenvoice_client",
"columnsFrom": [
"clientId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"beenvoice_invoice_createdById_beenvoice_user_id_fk": {
"name": "beenvoice_invoice_createdById_beenvoice_user_id_fk",
"tableFrom": "beenvoice_invoice",
"tableTo": "beenvoice_user",
"columnsFrom": [
"createdById"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"beenvoice_session": {
"name": "beenvoice_session",
"columns": {
"sessionToken": {
"name": "sessionToken",
"type": "text(255)",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"userId": {
"name": "userId",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"expires": {
"name": "expires",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"session_userId_idx": {
"name": "session_userId_idx",
"columns": [
"userId"
],
"isUnique": false
}
},
"foreignKeys": {
"beenvoice_session_userId_beenvoice_user_id_fk": {
"name": "beenvoice_session_userId_beenvoice_user_id_fk",
"tableFrom": "beenvoice_session",
"tableTo": "beenvoice_user",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"beenvoice_user": {
"name": "beenvoice_user",
"columns": {
"id": {
"name": "id",
"type": "text(255)",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"email": {
"name": "email",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"password": {
"name": "password",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"emailVerified": {
"name": "emailVerified",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": "(unixepoch())"
},
"image": {
"name": "image",
"type": "text(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"beenvoice_verification_token": {
"name": "beenvoice_verification_token",
"columns": {
"identifier": {
"name": "identifier",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"token": {
"name": "token",
"type": "text(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"expires": {
"name": "expires",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"beenvoice_verification_token_identifier_token_pk": {
"columns": [
"identifier",
"token"
],
"name": "beenvoice_verification_token_identifier_token_pk"
}
},
"uniqueConstraints": {},
"checkConstraints": {}
}
},
"views": {},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}

View File

@@ -0,0 +1,13 @@
{
"version": "7",
"dialect": "sqlite",
"entries": [
{
"idx": 0,
"version": "6",
"when": 1752275489999,
"tag": "0000_unique_loa",
"breakpoints": true
}
]
}