health-petal/packages/data-manager-sqlite/drizzle/meta/0003_snapshot.json
2026-05-23 16:20:42 +05:30

512 lines
No EOL
13 KiB
JSON

{
"version": "6",
"dialect": "sqlite",
"id": "7e0de346-d773-4526-85aa-96c7c9652ac9",
"prevId": "e65ed66a-0a3c-4338-8ba7-90ca587a7c07",
"tables": {
"storage_spaces": {
"name": "storage_spaces",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"aliases": {
"name": "aliases",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'[]'"
},
"image_urls": {
"name": "image_urls",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'[]'"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"distributors": {
"name": "distributors",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"agency": {
"name": "agency",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"contact": {
"name": "contact",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"mobile": {
"name": "mobile",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"address": {
"name": "address",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"products": {
"name": "products",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"brand": {
"name": "brand",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"category": {
"name": "category",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"distributor_id": {
"name": "distributor_id",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"unit_id": {
"name": "unit_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"procured_price": {
"name": "procured_price",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"mrp": {
"name": "mrp",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"selling_price": {
"name": "selling_price",
"type": "real",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"quantity": {
"name": "quantity",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"reorder_level": {
"name": "reorder_level",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
},
"units_per_strip": {
"name": "units_per_strip",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"hide_product_from_public": {
"name": "hide_product_from_public",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": false
},
"hide_price_from_public": {
"name": "hide_price_from_public",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": false
}
},
"indexes": {},
"foreignKeys": {
"products_distributor_id_distributors_id_fk": {
"name": "products_distributor_id_distributors_id_fk",
"tableFrom": "products",
"tableTo": "distributors",
"columnsFrom": [
"distributor_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"products_unit_id_units_id_fk": {
"name": "products_unit_id_units_id_fk",
"tableFrom": "products",
"tableTo": "units",
"columnsFrom": [
"unit_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"drug_info": {
"name": "drug_info",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"drug_info_name_unique": {
"name": "drug_info_name_unique",
"columns": [
"name"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"units": {
"name": "units",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"units_name_unique": {
"name": "units_name_unique",
"columns": [
"name"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"product_compositions": {
"name": "product_compositions",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"product_id": {
"name": "product_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"drug_info_id": {
"name": "drug_info_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"quantity": {
"name": "quantity",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"unit_id": {
"name": "unit_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"product_compositions_product_id_products_id_fk": {
"name": "product_compositions_product_id_products_id_fk",
"tableFrom": "product_compositions",
"tableTo": "products",
"columnsFrom": [
"product_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"product_compositions_drug_info_id_drug_info_id_fk": {
"name": "product_compositions_drug_info_id_drug_info_id_fk",
"tableFrom": "product_compositions",
"tableTo": "drug_info",
"columnsFrom": [
"drug_info_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"product_compositions_unit_id_units_id_fk": {
"name": "product_compositions_unit_id_units_id_fk",
"tableFrom": "product_compositions",
"tableTo": "units",
"columnsFrom": [
"unit_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"stock_batches": {
"name": "stock_batches",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"product_id": {
"name": "product_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"arrived": {
"name": "arrived",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"batch_no": {
"name": "batch_no",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"mfg": {
"name": "mfg",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"expiry": {
"name": "expiry",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"rack_id": {
"name": "rack_id",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"distributor_id": {
"name": "distributor_id",
"type": "integer",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"is_default": {
"name": "is_default",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": false
}
},
"indexes": {},
"foreignKeys": {
"stock_batches_product_id_products_id_fk": {
"name": "stock_batches_product_id_products_id_fk",
"tableFrom": "stock_batches",
"tableTo": "products",
"columnsFrom": [
"product_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"stock_batches_rack_id_storage_spaces_id_fk": {
"name": "stock_batches_rack_id_storage_spaces_id_fk",
"tableFrom": "stock_batches",
"tableTo": "storage_spaces",
"columnsFrom": [
"rack_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
},
"stock_batches_distributor_id_distributors_id_fk": {
"name": "stock_batches_distributor_id_distributors_id_fk",
"tableFrom": "stock_batches",
"tableTo": "distributors",
"columnsFrom": [
"distributor_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
}
},
"views": {},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"indexes": {}
}
}