compassmock/drizzle/meta/0005_snapshot.json
Nicholai 9c3a19279a
feat(schema): add auth, people, and financial tables (#26)
Add users, organizations, teams, groups, and project
members tables. Extend customers/vendors with netsuite
fields. Add netsuite schema for invoices, bills,
payments, and credit memos. Include all migrations,
seeds, new UI primitives, and config updates.

Co-authored-by: Nicholai <nicholaivogelfilms@gmail.com>
2026-02-04 16:18:39 -07:00

1559 lines
40 KiB
JSON
Executable File

{
"version": "6",
"dialect": "sqlite",
"id": "2c6803c6-ee81-4536-ab3f-8d2e4f27ec2e",
"prevId": "b6fe056d-1639-42cd-9360-80d10f7ebb3a",
"tables": {
"customers": {
"name": "customers",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"phone": {
"name": "phone",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"netsuite_id": {
"name": "netsuite_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"feedback": {
"name": "feedback",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"message": {
"name": "message",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"page_url": {
"name": "page_url",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"user_agent": {
"name": "user_agent",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"viewport_width": {
"name": "viewport_width",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"viewport_height": {
"name": "viewport_height",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"ip_hash": {
"name": "ip_hash",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"github_issue_url": {
"name": "github_issue_url",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"projects": {
"name": "projects",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'OPEN'"
},
"address": {
"name": "address",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"client_name": {
"name": "client_name",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"project_manager": {
"name": "project_manager",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"netsuite_job_id": {
"name": "netsuite_job_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"schedule_baselines": {
"name": "schedule_baselines",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"snapshot_data": {
"name": "snapshot_data",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"schedule_baselines_project_id_projects_id_fk": {
"name": "schedule_baselines_project_id_projects_id_fk",
"tableFrom": "schedule_baselines",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"schedule_tasks": {
"name": "schedule_tasks",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"start_date": {
"name": "start_date",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"workdays": {
"name": "workdays",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"end_date_calculated": {
"name": "end_date_calculated",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"phase": {
"name": "phase",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'PENDING'"
},
"is_critical_path": {
"name": "is_critical_path",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": false
},
"is_milestone": {
"name": "is_milestone",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": false
},
"percent_complete": {
"name": "percent_complete",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"assigned_to": {
"name": "assigned_to",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"sort_order": {
"name": "sort_order",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"schedule_tasks_project_id_projects_id_fk": {
"name": "schedule_tasks_project_id_projects_id_fk",
"tableFrom": "schedule_tasks",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"task_dependencies": {
"name": "task_dependencies",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"predecessor_id": {
"name": "predecessor_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"successor_id": {
"name": "successor_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'FS'"
},
"lag_days": {
"name": "lag_days",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
}
},
"indexes": {},
"foreignKeys": {
"task_dependencies_predecessor_id_schedule_tasks_id_fk": {
"name": "task_dependencies_predecessor_id_schedule_tasks_id_fk",
"tableFrom": "task_dependencies",
"tableTo": "schedule_tasks",
"columnsFrom": [
"predecessor_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"task_dependencies_successor_id_schedule_tasks_id_fk": {
"name": "task_dependencies_successor_id_schedule_tasks_id_fk",
"tableFrom": "task_dependencies",
"tableTo": "schedule_tasks",
"columnsFrom": [
"successor_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"vendors": {
"name": "vendors",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"category": {
"name": "category",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'Subcontractor'"
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"phone": {
"name": "phone",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"address": {
"name": "address",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"netsuite_id": {
"name": "netsuite_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"workday_exceptions": {
"name": "workday_exceptions",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"start_date": {
"name": "start_date",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"end_date": {
"name": "end_date",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'non_working'"
},
"category": {
"name": "category",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'company_holiday'"
},
"recurrence": {
"name": "recurrence",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'one_time'"
},
"notes": {
"name": "notes",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"workday_exceptions_project_id_projects_id_fk": {
"name": "workday_exceptions_project_id_projects_id_fk",
"tableFrom": "workday_exceptions",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"credit_memos": {
"name": "credit_memos",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"netsuite_id": {
"name": "netsuite_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"customer_id": {
"name": "customer_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"memo_number": {
"name": "memo_number",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'draft'"
},
"issue_date": {
"name": "issue_date",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"total": {
"name": "total",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"amount_applied": {
"name": "amount_applied",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"amount_remaining": {
"name": "amount_remaining",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"memo": {
"name": "memo",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"line_items": {
"name": "line_items",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"credit_memos_customer_id_customers_id_fk": {
"name": "credit_memos_customer_id_customers_id_fk",
"tableFrom": "credit_memos",
"tableTo": "customers",
"columnsFrom": [
"customer_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"credit_memos_project_id_projects_id_fk": {
"name": "credit_memos_project_id_projects_id_fk",
"tableFrom": "credit_memos",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"invoices": {
"name": "invoices",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"netsuite_id": {
"name": "netsuite_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"customer_id": {
"name": "customer_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"invoice_number": {
"name": "invoice_number",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'draft'"
},
"issue_date": {
"name": "issue_date",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"due_date": {
"name": "due_date",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"subtotal": {
"name": "subtotal",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"tax": {
"name": "tax",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"total": {
"name": "total",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"amount_paid": {
"name": "amount_paid",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"amount_due": {
"name": "amount_due",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"memo": {
"name": "memo",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"line_items": {
"name": "line_items",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"invoices_customer_id_customers_id_fk": {
"name": "invoices_customer_id_customers_id_fk",
"tableFrom": "invoices",
"tableTo": "customers",
"columnsFrom": [
"customer_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"invoices_project_id_projects_id_fk": {
"name": "invoices_project_id_projects_id_fk",
"tableFrom": "invoices",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"netsuite_auth": {
"name": "netsuite_auth",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"account_id": {
"name": "account_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"access_token_encrypted": {
"name": "access_token_encrypted",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"refresh_token_encrypted": {
"name": "refresh_token_encrypted",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"expires_in": {
"name": "expires_in",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"token_type": {
"name": "token_type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"issued_at": {
"name": "issued_at",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"netsuite_sync_log": {
"name": "netsuite_sync_log",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"sync_type": {
"name": "sync_type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"record_type": {
"name": "record_type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"direction": {
"name": "direction",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"records_processed": {
"name": "records_processed",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"records_failed": {
"name": "records_failed",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"error_summary": {
"name": "error_summary",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"started_at": {
"name": "started_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"completed_at": {
"name": "completed_at",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"netsuite_sync_metadata": {
"name": "netsuite_sync_metadata",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"local_table": {
"name": "local_table",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"local_record_id": {
"name": "local_record_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"netsuite_record_type": {
"name": "netsuite_record_type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"netsuite_internal_id": {
"name": "netsuite_internal_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"last_synced_at": {
"name": "last_synced_at",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"last_modified_local": {
"name": "last_modified_local",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"last_modified_remote": {
"name": "last_modified_remote",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"sync_status": {
"name": "sync_status",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'synced'"
},
"conflict_data": {
"name": "conflict_data",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"error_message": {
"name": "error_message",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"retry_count": {
"name": "retry_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"payments": {
"name": "payments",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"netsuite_id": {
"name": "netsuite_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"customer_id": {
"name": "customer_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"vendor_id": {
"name": "vendor_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"payment_type": {
"name": "payment_type",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"amount": {
"name": "amount",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"payment_date": {
"name": "payment_date",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"payment_method": {
"name": "payment_method",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"reference_number": {
"name": "reference_number",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"memo": {
"name": "memo",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"payments_customer_id_customers_id_fk": {
"name": "payments_customer_id_customers_id_fk",
"tableFrom": "payments",
"tableTo": "customers",
"columnsFrom": [
"customer_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"payments_vendor_id_vendors_id_fk": {
"name": "payments_vendor_id_vendors_id_fk",
"tableFrom": "payments",
"tableTo": "vendors",
"columnsFrom": [
"vendor_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"payments_project_id_projects_id_fk": {
"name": "payments_project_id_projects_id_fk",
"tableFrom": "payments",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"vendor_bills": {
"name": "vendor_bills",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"netsuite_id": {
"name": "netsuite_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"vendor_id": {
"name": "vendor_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"project_id": {
"name": "project_id",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"bill_number": {
"name": "bill_number",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'pending'"
},
"bill_date": {
"name": "bill_date",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"due_date": {
"name": "due_date",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"subtotal": {
"name": "subtotal",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"tax": {
"name": "tax",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"total": {
"name": "total",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"amount_paid": {
"name": "amount_paid",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"amount_due": {
"name": "amount_due",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"memo": {
"name": "memo",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"line_items": {
"name": "line_items",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"updated_at": {
"name": "updated_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"vendor_bills_vendor_id_vendors_id_fk": {
"name": "vendor_bills_vendor_id_vendors_id_fk",
"tableFrom": "vendor_bills",
"tableTo": "vendors",
"columnsFrom": [
"vendor_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"vendor_bills_project_id_projects_id_fk": {
"name": "vendor_bills_project_id_projects_id_fk",
"tableFrom": "vendor_bills",
"tableTo": "projects",
"columnsFrom": [
"project_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
}
},
"views": {},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}