1380 lines
No EOL
35 KiB
JSON
1380 lines
No EOL
35 KiB
JSON
{
|
|
"version": "6",
|
|
"dialect": "sqlite",
|
|
"id": "2eafc73e-0dde-444b-bf3b-a27420a05f2b",
|
|
"prevId": "737f8f6d-432c-489e-84d0-54f906a6faca",
|
|
"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": "'[]'"
|
|
},
|
|
"enterprise_id": {
|
|
"name": "enterprise_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"storage_spaces_enterprise_idx": {
|
|
"name": "storage_spaces_enterprise_idx",
|
|
"columns": [
|
|
"enterprise_id"
|
|
],
|
|
"isUnique": false
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"storage_spaces_enterprise_id_enterprises_id_fk": {
|
|
"name": "storage_spaces_enterprise_id_enterprises_id_fk",
|
|
"tableFrom": "storage_spaces",
|
|
"tableTo": "enterprises",
|
|
"columnsFrom": [
|
|
"enterprise_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"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
|
|
},
|
|
"enterprise_id": {
|
|
"name": "enterprise_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"distributors_enterprise_idx": {
|
|
"name": "distributors_enterprise_idx",
|
|
"columns": [
|
|
"enterprise_id"
|
|
],
|
|
"isUnique": false
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"distributors_enterprise_id_enterprises_id_fk": {
|
|
"name": "distributors_enterprise_id_enterprises_id_fk",
|
|
"tableFrom": "distributors",
|
|
"tableTo": "enterprises",
|
|
"columnsFrom": [
|
|
"enterprise_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"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
|
|
},
|
|
"size": {
|
|
"name": "size",
|
|
"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
|
|
},
|
|
"enterprise_id": {
|
|
"name": "enterprise_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"products_enterprise_idx": {
|
|
"name": "products_enterprise_idx",
|
|
"columns": [
|
|
"enterprise_id"
|
|
],
|
|
"isUnique": false
|
|
}
|
|
},
|
|
"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"
|
|
},
|
|
"products_enterprise_id_enterprises_id_fk": {
|
|
"name": "products_enterprise_id_enterprises_id_fk",
|
|
"tableFrom": "products",
|
|
"tableTo": "enterprises",
|
|
"columnsFrom": [
|
|
"enterprise_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
|
|
},
|
|
"quantity": {
|
|
"name": "quantity",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": 0
|
|
},
|
|
"is_default": {
|
|
"name": "is_default",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": false
|
|
},
|
|
"enterprise_id": {
|
|
"name": "enterprise_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"stock_batches_enterprise_idx": {
|
|
"name": "stock_batches_enterprise_idx",
|
|
"columns": [
|
|
"enterprise_id"
|
|
],
|
|
"isUnique": false
|
|
}
|
|
},
|
|
"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"
|
|
},
|
|
"stock_batches_enterprise_id_enterprises_id_fk": {
|
|
"name": "stock_batches_enterprise_id_enterprises_id_fk",
|
|
"tableFrom": "stock_batches",
|
|
"tableTo": "enterprises",
|
|
"columnsFrom": [
|
|
"enterprise_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"checkConstraints": {}
|
|
},
|
|
"enterprises": {
|
|
"name": "enterprises",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "integer",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"autoincrement": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"type": {
|
|
"name": "type",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"owner_name": {
|
|
"name": "owner_name",
|
|
"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": {}
|
|
},
|
|
"staff": {
|
|
"name": "staff",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "integer",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"autoincrement": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"username": {
|
|
"name": "username",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"mobile": {
|
|
"name": "mobile",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"added_on": {
|
|
"name": "added_on",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"password": {
|
|
"name": "password",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"is_password_reset_needed": {
|
|
"name": "is_password_reset_needed",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": true
|
|
}
|
|
},
|
|
"indexes": {
|
|
"staff_username_unique": {
|
|
"name": "staff_username_unique",
|
|
"columns": [
|
|
"username"
|
|
],
|
|
"isUnique": true
|
|
}
|
|
},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"checkConstraints": {}
|
|
},
|
|
"roles": {
|
|
"name": "roles",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "integer",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"autoincrement": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"roles_name_unique": {
|
|
"name": "roles_name_unique",
|
|
"columns": [
|
|
"name"
|
|
],
|
|
"isUnique": true
|
|
}
|
|
},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"checkConstraints": {}
|
|
},
|
|
"permissions": {
|
|
"name": "permissions",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "integer",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"autoincrement": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"permissions_name_unique": {
|
|
"name": "permissions_name_unique",
|
|
"columns": [
|
|
"name"
|
|
],
|
|
"isUnique": true
|
|
}
|
|
},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"checkConstraints": {}
|
|
},
|
|
"role_permissions": {
|
|
"name": "role_permissions",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "integer",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"autoincrement": true
|
|
},
|
|
"role_id": {
|
|
"name": "role_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"permission_id": {
|
|
"name": "permission_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"role_permissions_role_id_permission_id_unique": {
|
|
"name": "role_permissions_role_id_permission_id_unique",
|
|
"columns": [
|
|
"role_id",
|
|
"permission_id"
|
|
],
|
|
"isUnique": true
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"role_permissions_role_id_roles_id_fk": {
|
|
"name": "role_permissions_role_id_roles_id_fk",
|
|
"tableFrom": "role_permissions",
|
|
"tableTo": "roles",
|
|
"columnsFrom": [
|
|
"role_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"role_permissions_permission_id_permissions_id_fk": {
|
|
"name": "role_permissions_permission_id_permissions_id_fk",
|
|
"tableFrom": "role_permissions",
|
|
"tableTo": "permissions",
|
|
"columnsFrom": [
|
|
"permission_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"checkConstraints": {}
|
|
},
|
|
"staff_roles": {
|
|
"name": "staff_roles",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "integer",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"autoincrement": true
|
|
},
|
|
"staff_id": {
|
|
"name": "staff_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"role_id": {
|
|
"name": "role_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"staff_roles_staff_id_role_id_unique": {
|
|
"name": "staff_roles_staff_id_role_id_unique",
|
|
"columns": [
|
|
"staff_id",
|
|
"role_id"
|
|
],
|
|
"isUnique": true
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"staff_roles_staff_id_staff_id_fk": {
|
|
"name": "staff_roles_staff_id_staff_id_fk",
|
|
"tableFrom": "staff_roles",
|
|
"tableTo": "staff",
|
|
"columnsFrom": [
|
|
"staff_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"staff_roles_role_id_roles_id_fk": {
|
|
"name": "staff_roles_role_id_roles_id_fk",
|
|
"tableFrom": "staff_roles",
|
|
"tableTo": "roles",
|
|
"columnsFrom": [
|
|
"role_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"checkConstraints": {}
|
|
},
|
|
"enterprise_staff": {
|
|
"name": "enterprise_staff",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "integer",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"autoincrement": true
|
|
},
|
|
"staff_id": {
|
|
"name": "staff_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"enterprise_id": {
|
|
"name": "enterprise_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"enterprise_staff_staff_id_enterprise_id_unique": {
|
|
"name": "enterprise_staff_staff_id_enterprise_id_unique",
|
|
"columns": [
|
|
"staff_id",
|
|
"enterprise_id"
|
|
],
|
|
"isUnique": true
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"enterprise_staff_staff_id_staff_id_fk": {
|
|
"name": "enterprise_staff_staff_id_staff_id_fk",
|
|
"tableFrom": "enterprise_staff",
|
|
"tableTo": "staff",
|
|
"columnsFrom": [
|
|
"staff_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"enterprise_staff_enterprise_id_enterprises_id_fk": {
|
|
"name": "enterprise_staff_enterprise_id_enterprises_id_fk",
|
|
"tableFrom": "enterprise_staff",
|
|
"tableTo": "enterprises",
|
|
"columnsFrom": [
|
|
"enterprise_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"checkConstraints": {}
|
|
},
|
|
"customers": {
|
|
"name": "customers",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "integer",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"autoincrement": true
|
|
},
|
|
"mobile": {
|
|
"name": "mobile",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"added_on": {
|
|
"name": "added_on",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"enterprise_id": {
|
|
"name": "enterprise_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"customers_mobile_unique": {
|
|
"name": "customers_mobile_unique",
|
|
"columns": [
|
|
"mobile"
|
|
],
|
|
"isUnique": true
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"customers_enterprise_id_enterprises_id_fk": {
|
|
"name": "customers_enterprise_id_enterprises_id_fk",
|
|
"tableFrom": "customers",
|
|
"tableTo": "enterprises",
|
|
"columnsFrom": [
|
|
"enterprise_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"checkConstraints": {}
|
|
},
|
|
"bills": {
|
|
"name": "bills",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "integer",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"autoincrement": true
|
|
},
|
|
"bill_no": {
|
|
"name": "bill_no",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"customer_mobile": {
|
|
"name": "customer_mobile",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"customer_name": {
|
|
"name": "customer_name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"subtotal": {
|
|
"name": "subtotal",
|
|
"type": "real",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"tax": {
|
|
"name": "tax",
|
|
"type": "real",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"tax_rate": {
|
|
"name": "tax_rate",
|
|
"type": "real",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": 18
|
|
},
|
|
"total": {
|
|
"name": "total",
|
|
"type": "real",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"discount": {
|
|
"name": "discount",
|
|
"type": "real",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": 0
|
|
},
|
|
"discount_percent": {
|
|
"name": "discount_percent",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": 0
|
|
},
|
|
"generated_by": {
|
|
"name": "generated_by",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"enterprise_id": {
|
|
"name": "enterprise_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"bills_generated_by_staff_id_fk": {
|
|
"name": "bills_generated_by_staff_id_fk",
|
|
"tableFrom": "bills",
|
|
"tableTo": "staff",
|
|
"columnsFrom": [
|
|
"generated_by"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"bills_enterprise_id_enterprises_id_fk": {
|
|
"name": "bills_enterprise_id_enterprises_id_fk",
|
|
"tableFrom": "bills",
|
|
"tableTo": "enterprises",
|
|
"columnsFrom": [
|
|
"enterprise_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"checkConstraints": {}
|
|
},
|
|
"bill_items": {
|
|
"name": "bill_items",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "integer",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"autoincrement": true
|
|
},
|
|
"bill_id": {
|
|
"name": "bill_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"product_id": {
|
|
"name": "product_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"batch_id": {
|
|
"name": "batch_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"product_name": {
|
|
"name": "product_name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"brand": {
|
|
"name": "brand",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"autoincrement": false
|
|
},
|
|
"strips": {
|
|
"name": "strips",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": 0
|
|
},
|
|
"loose": {
|
|
"name": "loose",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false,
|
|
"default": 0
|
|
},
|
|
"qty": {
|
|
"name": "qty",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"original_price": {
|
|
"name": "original_price",
|
|
"type": "real",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"selling_price": {
|
|
"name": "selling_price",
|
|
"type": "real",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"total": {
|
|
"name": "total",
|
|
"type": "real",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
},
|
|
"enterprise_id": {
|
|
"name": "enterprise_id",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"autoincrement": false
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"bill_items_bill_id_bills_id_fk": {
|
|
"name": "bill_items_bill_id_bills_id_fk",
|
|
"tableFrom": "bill_items",
|
|
"tableTo": "bills",
|
|
"columnsFrom": [
|
|
"bill_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"bill_items_product_id_products_id_fk": {
|
|
"name": "bill_items_product_id_products_id_fk",
|
|
"tableFrom": "bill_items",
|
|
"tableTo": "products",
|
|
"columnsFrom": [
|
|
"product_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"bill_items_batch_id_stock_batches_id_fk": {
|
|
"name": "bill_items_batch_id_stock_batches_id_fk",
|
|
"tableFrom": "bill_items",
|
|
"tableTo": "stock_batches",
|
|
"columnsFrom": [
|
|
"batch_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
},
|
|
"bill_items_enterprise_id_enterprises_id_fk": {
|
|
"name": "bill_items_enterprise_id_enterprises_id_fk",
|
|
"tableFrom": "bill_items",
|
|
"tableTo": "enterprises",
|
|
"columnsFrom": [
|
|
"enterprise_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"checkConstraints": {}
|
|
}
|
|
},
|
|
"views": {},
|
|
"enums": {},
|
|
"_meta": {
|
|
"schemas": {},
|
|
"tables": {},
|
|
"columns": {}
|
|
},
|
|
"internal": {
|
|
"indexes": {}
|
|
}
|
|
} |