Files
dkala-api/database/migrations/.snapshot-dkala.json
T
morteza 2d34fb68e7
deploy to danak / build_and_deploy (push) Has been cancelled
add config module
2026-05-17 17:01:50 +03:30

5490 lines
141 KiB
JSON

{
"namespaces": [
"public"
],
"name": "public",
"tables": [
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"first_name": {
"name": "first_name",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"last_name": {
"name": "last_name",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"phone": {
"name": "phone",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
}
},
"name": "admins",
"schema": "public",
"indexes": [
{
"columnNames": [
"phone"
],
"composite": false,
"keyName": "admins_phone_unique",
"constraint": true,
"primary": false,
"unique": true
},
{
"keyName": "admins_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "admins_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "admins_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"name": {
"name": "name",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
}
},
"name": "icon_groups",
"schema": "public",
"indexes": [
{
"keyName": "icon_groups_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "icon_groups_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "icon_groups_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"url": {
"name": "url",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"group_id": {
"name": "group_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
}
},
"name": "icons",
"schema": "public",
"indexes": [
{
"keyName": "icons_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "icons_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "icons_group_id_index",
"columnNames": [
"group_id"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "icons_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"icons_group_id_foreign": {
"constraintName": "icons_group_id_foreign",
"columnNames": [
"group_id"
],
"localTableName": "public.icons",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.icon_groups",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"name": {
"name": "name",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"title": {
"name": "title",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
}
},
"name": "permissions",
"schema": "public",
"indexes": [
{
"columnNames": [
"name"
],
"composite": false,
"keyName": "permissions_name_unique",
"constraint": true,
"primary": false,
"unique": true
},
{
"keyName": "permissions_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "permissions_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "permissions_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"hashed_token": {
"name": "hashed_token",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"owner_id": {
"name": "owner_id",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"shop_id": {
"name": "shop_id",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"type": {
"name": "type",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"enumItems": [
"user",
"admin"
],
"mappedType": "enum"
},
"expires_at": {
"name": "expires_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"mappedType": "datetime"
}
},
"name": "refreshtokens",
"schema": "public",
"indexes": [
{
"keyName": "refreshtokens_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "refreshtokens_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "refreshtokens_expires_at_index",
"columnNames": [
"expires_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "refreshtokens_hashed_token_index",
"columnNames": [
"hashed_token"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "refreshtokens_owner_id_shop_id_type_index",
"columnNames": [
"owner_id",
"shop_id",
"type"
],
"composite": true,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "refreshtokens_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"week_day": {
"name": "week_day",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "integer"
},
"open_time": {
"name": "open_time",
"type": "time(0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 0,
"mappedType": "time"
},
"close_time": {
"name": "close_time",
"type": "time(0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 0,
"mappedType": "time"
},
"is_active": {
"name": "is_active",
"type": "boolean",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "true",
"mappedType": "boolean"
},
"shop_id": {
"name": "shop_id",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
}
},
"name": "schedules",
"schema": "public",
"indexes": [
{
"keyName": "schedules_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "schedules_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "schedules_shop_id_index",
"columnNames": [
"shop_id"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "schedules_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"name": {
"name": "name",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"slug": {
"name": "slug",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"logo": {
"name": "logo",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"address": {
"name": "address",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"menu_color": {
"name": "menu_color",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"latitude": {
"name": "latitude",
"type": "numeric(10,7)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"precision": 10,
"scale": 7,
"mappedType": "decimal"
},
"longitude": {
"name": "longitude",
"type": "numeric(10,7)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"precision": 10,
"scale": 7,
"mappedType": "decimal"
},
"service_area": {
"name": "service_area",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"is_active": {
"name": "is_active",
"type": "boolean",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "true",
"mappedType": "boolean"
},
"established_year": {
"name": "established_year",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "integer"
},
"phone": {
"name": "phone",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"instagram": {
"name": "instagram",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"telegram": {
"name": "telegram",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"whatsapp": {
"name": "whatsapp",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"description": {
"name": "description",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"seo_title": {
"name": "seo_title",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"seo_description": {
"name": "seo_description",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"tag_names": {
"name": "tag_names",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"images": {
"name": "images",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"vat": {
"name": "vat",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"default": "0",
"mappedType": "decimal"
},
"domain": {
"name": "domain",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"score": {
"name": "score",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"subscription_id": {
"name": "subscription_id",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"subscription_end_date": {
"name": "subscription_end_date",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"subscription_start_date": {
"name": "subscription_start_date",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
}
},
"name": "shops",
"schema": "public",
"indexes": [
{
"columnNames": [
"slug"
],
"composite": false,
"keyName": "shops_slug_unique",
"constraint": true,
"primary": false,
"unique": true
},
{
"columnNames": [
"subscription_id"
],
"composite": false,
"keyName": "shops_subscription_id_unique",
"constraint": true,
"primary": false,
"unique": true
},
{
"keyName": "shops_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "shops_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "shops_slug_index",
"columnNames": [
"slug"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "shops_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"name": {
"name": "name",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"is_system": {
"name": "is_system",
"type": "boolean",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "false",
"mappedType": "boolean"
},
"shop_id": {
"name": "shop_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 26,
"mappedType": "character"
}
},
"name": "roles",
"schema": "public",
"indexes": [
{
"keyName": "roles_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "roles_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "roles_shop_id_index",
"columnNames": [
"shop_id"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "roles_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"roles_shop_id_foreign": {
"constraintName": "roles_shop_id_foreign",
"columnNames": [
"shop_id"
],
"localTableName": "public.roles",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.shops",
"deleteRule": "set null",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"role_id": {
"name": "role_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"permission_id": {
"name": "permission_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
}
},
"name": "role_permissions",
"schema": "public",
"indexes": [
{
"keyName": "role_permissions_pkey",
"columnNames": [
"role_id",
"permission_id"
],
"composite": true,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"role_permissions_role_id_foreign": {
"constraintName": "role_permissions_role_id_foreign",
"columnNames": [
"role_id"
],
"localTableName": "public.role_permissions",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.roles",
"updateRule": "cascade"
},
"role_permissions_permission_id_foreign": {
"constraintName": "role_permissions_permission_id_foreign",
"columnNames": [
"permission_id"
],
"localTableName": "public.role_permissions",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.permissions",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"shop_id": {
"name": "shop_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"method": {
"name": "method",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"enumItems": [
"Online",
"Cash",
"Wallet"
],
"mappedType": "enum"
},
"gateway": {
"name": "gateway",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"enumItems": [
"zarinpal"
],
"mappedType": "enum"
},
"description": {
"name": "description",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"enabled": {
"name": "enabled",
"type": "boolean",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "true",
"mappedType": "boolean"
},
"order": {
"name": "order",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "0",
"mappedType": "integer"
},
"merchant_id": {
"name": "merchant_id",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
}
},
"name": "payment_methods",
"schema": "public",
"indexes": [
{
"keyName": "payment_methods_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "payment_methods_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "payment_methods_shop_id_enabled_index",
"columnNames": [
"shop_id",
"enabled"
],
"composite": true,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "payment_methods_shop_id_method_unique",
"columnNames": [
"shop_id",
"method"
],
"composite": true,
"constraint": true,
"primary": false,
"unique": true
},
{
"keyName": "payment_methods_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"payment_methods_shop_id_foreign": {
"constraintName": "payment_methods_shop_id_foreign",
"columnNames": [
"shop_id"
],
"localTableName": "public.payment_methods",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.shops",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"shop_id": {
"name": "shop_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"title": {
"name": "title",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"channels": {
"name": "channels",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "json"
}
},
"name": "notification_preferences",
"schema": "public",
"indexes": [
{
"keyName": "notification_preferences_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "notification_preferences_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "notification_preferences_shop_id_title_unique",
"columnNames": [
"shop_id",
"title"
],
"composite": true,
"constraint": true,
"primary": false,
"unique": true
},
{
"keyName": "notification_preferences_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"notification_preferences_shop_id_foreign": {
"constraintName": "notification_preferences_shop_id_foreign",
"columnNames": [
"shop_id"
],
"localTableName": "public.notification_preferences",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.shops",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"method": {
"name": "method",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"enumItems": [
"customerPickup",
"deliveryCourier"
],
"mappedType": "enum"
},
"shop_id": {
"name": "shop_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"delivery_fee": {
"name": "delivery_fee",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"default": "0",
"mappedType": "decimal"
},
"delivery_fee_type": {
"name": "delivery_fee_type",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "'fixed'",
"enumItems": [
"fixed",
"distanceBased"
],
"mappedType": "enum"
},
"per_kilometer_fee": {
"name": "per_kilometer_fee",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"precision": 10,
"scale": 0,
"default": "0",
"mappedType": "decimal"
},
"distance_based_min_cost": {
"name": "distance_based_min_cost",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"precision": 10,
"scale": 0,
"default": "0",
"mappedType": "decimal"
},
"min_order_price": {
"name": "min_order_price",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"default": "0",
"mappedType": "decimal"
},
"description": {
"name": "description",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"enabled": {
"name": "enabled",
"type": "boolean",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "true",
"mappedType": "boolean"
},
"order": {
"name": "order",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "0",
"mappedType": "integer"
}
},
"name": "deliveries",
"schema": "public",
"indexes": [
{
"keyName": "deliveries_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "deliveries_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "deliveries_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"deliveries_shop_id_foreign": {
"constraintName": "deliveries_shop_id_foreign",
"columnNames": [
"shop_id"
],
"localTableName": "public.deliveries",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.shops",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"shop_id": {
"name": "shop_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"code": {
"name": "code",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"name": {
"name": "name",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"description": {
"name": "description",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"type": {
"name": "type",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"enumItems": [
"PERCENTAGE",
"FIXED"
],
"mappedType": "enum"
},
"value": {
"name": "value",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"mappedType": "decimal"
},
"max_discount": {
"name": "max_discount",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"precision": 10,
"scale": 0,
"mappedType": "decimal"
},
"min_order_amount": {
"name": "min_order_amount",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"precision": 10,
"scale": 0,
"mappedType": "decimal"
},
"max_uses": {
"name": "max_uses",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "integer"
},
"used_count": {
"name": "used_count",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "0",
"mappedType": "integer"
},
"max_uses_per_user": {
"name": "max_uses_per_user",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "integer"
},
"start_date": {
"name": "start_date",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"end_date": {
"name": "end_date",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"is_active": {
"name": "is_active",
"type": "boolean",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "true",
"mappedType": "boolean"
},
"product_categories": {
"name": "product_categories",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"products": {
"name": "products",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"user_phone": {
"name": "user_phone",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
}
},
"name": "coupons",
"schema": "public",
"indexes": [
{
"keyName": "coupons_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "coupons_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "coupons_code_index",
"columnNames": [
"code"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "coupons_shop_id_is_active_index",
"columnNames": [
"shop_id",
"is_active"
],
"composite": true,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "coupons_shop_id_code_is_active_index",
"columnNames": [
"shop_id",
"code",
"is_active"
],
"composite": true,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "coupons_code_shop_id_unique",
"columnNames": [
"code",
"shop_id"
],
"composite": true,
"constraint": true,
"primary": false,
"unique": true
},
{
"keyName": "coupons_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"coupons_shop_id_foreign": {
"constraintName": "coupons_shop_id_foreign",
"columnNames": [
"shop_id"
],
"localTableName": "public.coupons",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.shops",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"subject": {
"name": "subject",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"content": {
"name": "content",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"phone": {
"name": "phone",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"scope": {
"name": "scope",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"enumItems": [
"application",
"shop"
],
"mappedType": "enum"
},
"shop_id": {
"name": "shop_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 26,
"mappedType": "character"
},
"status": {
"name": "status",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"default": "'new'",
"mappedType": "string"
}
},
"name": "contacts",
"schema": "public",
"indexes": [
{
"keyName": "contacts_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "contacts_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "contacts_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"contacts_shop_id_foreign": {
"constraintName": "contacts_shop_id_foreign",
"columnNames": [
"shop_id"
],
"localTableName": "public.contacts",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.shops",
"deleteRule": "set null",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"key": {
"name": "key",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"value": {
"name": "value",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"shop_id": {
"name": "shop_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 26,
"mappedType": "character"
}
},
"name": "configs",
"schema": "public",
"indexes": [
{
"keyName": "configs_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "configs_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "configs_shop_id_key_unique",
"columnNames": [
"shop_id",
"key"
],
"composite": true,
"constraint": true,
"primary": false,
"unique": true
},
{
"keyName": "configs_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"configs_shop_id_foreign": {
"constraintName": "configs_shop_id_foreign",
"columnNames": [
"shop_id"
],
"localTableName": "public.configs",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.shops",
"deleteRule": "set null",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"parent_id": {
"name": "parent_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 26,
"mappedType": "character"
},
"title": {
"name": "title",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"is_active": {
"name": "is_active",
"type": "boolean",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "true",
"mappedType": "boolean"
},
"shop_id": {
"name": "shop_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"avatar_url": {
"name": "avatar_url",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"order": {
"name": "order",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "integer"
}
},
"name": "categories",
"schema": "public",
"indexes": [
{
"keyName": "categories_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "categories_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "categories_is_active_index",
"columnNames": [
"is_active"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "categories_shop_id_is_active_index",
"columnNames": [
"shop_id",
"is_active"
],
"composite": true,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "categories_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"categories_parent_id_foreign": {
"constraintName": "categories_parent_id_foreign",
"columnNames": [
"parent_id"
],
"localTableName": "public.categories",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.categories",
"deleteRule": "set null",
"updateRule": "cascade"
},
"categories_shop_id_foreign": {
"constraintName": "categories_shop_id_foreign",
"columnNames": [
"shop_id"
],
"localTableName": "public.categories",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.shops",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"shop_id": {
"name": "shop_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"category_id": {
"name": "category_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"attribute": {
"name": "attribute",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"title": {
"name": "title",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"desc": {
"name": "desc",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"order": {
"name": "order",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "integer"
},
"is_active": {
"name": "is_active",
"type": "boolean",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "true",
"mappedType": "boolean"
},
"images": {
"name": "images",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"score": {
"name": "score",
"type": "real",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"default": "null",
"mappedType": "float"
},
"discount": {
"name": "discount",
"type": "real",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "0",
"mappedType": "float"
},
"is_special_offer": {
"name": "is_special_offer",
"type": "boolean",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "false",
"mappedType": "boolean"
},
"price": {
"name": "price",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"precision": 10,
"scale": 0,
"mappedType": "decimal"
},
"max_purchase_quantity": {
"name": "max_purchase_quantity",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"default": "null",
"mappedType": "integer"
}
},
"name": "products",
"schema": "public",
"indexes": [
{
"keyName": "products_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "products_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "products_is_active_index",
"columnNames": [
"is_active"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "products_category_id_is_active_index",
"columnNames": [
"category_id",
"is_active"
],
"composite": true,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "products_shop_id_index",
"columnNames": [
"shop_id"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "products_shop_id_is_active_index",
"columnNames": [
"shop_id",
"is_active"
],
"composite": true,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "products_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"products_shop_id_foreign": {
"constraintName": "products_shop_id_foreign",
"columnNames": [
"shop_id"
],
"localTableName": "public.products",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.shops",
"updateRule": "cascade"
},
"products_category_id_foreign": {
"constraintName": "products_category_id_foreign",
"columnNames": [
"category_id"
],
"localTableName": "public.products",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.categories",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"admin_id": {
"name": "admin_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"role_id": {
"name": "role_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"shop_id": {
"name": "shop_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 26,
"mappedType": "character"
}
},
"name": "admin_roles",
"schema": "public",
"indexes": [
{
"keyName": "admin_roles_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "admin_roles_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "admin_roles_shop_id_index",
"columnNames": [
"shop_id"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "admin_roles_admin_id_index",
"columnNames": [
"admin_id"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "admin_roles_admin_id_shop_id_index",
"columnNames": [
"admin_id",
"shop_id"
],
"composite": true,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "admin_roles_admin_id_shop_id_unique",
"columnNames": [
"admin_id",
"shop_id"
],
"composite": true,
"constraint": true,
"primary": false,
"unique": true
},
{
"keyName": "admin_roles_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"admin_roles_admin_id_foreign": {
"constraintName": "admin_roles_admin_id_foreign",
"columnNames": [
"admin_id"
],
"localTableName": "public.admin_roles",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.admins",
"updateRule": "cascade"
},
"admin_roles_role_id_foreign": {
"constraintName": "admin_roles_role_id_foreign",
"columnNames": [
"role_id"
],
"localTableName": "public.admin_roles",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.roles",
"updateRule": "cascade"
},
"admin_roles_shop_id_foreign": {
"constraintName": "admin_roles_shop_id_foreign",
"columnNames": [
"shop_id"
],
"localTableName": "public.admin_roles",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.shops",
"deleteRule": "set null",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "serial",
"unsigned": false,
"autoincrement": true,
"primary": true,
"nullable": false,
"mappedType": "integer"
},
"shop_id": {
"name": "shop_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"phone": {
"name": "phone",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"mappedType": "datetime"
}
},
"name": "sms_logs",
"schema": "public",
"indexes": [
{
"keyName": "sms_logs_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"sms_logs_shop_id_foreign": {
"constraintName": "sms_logs_shop_id_foreign",
"columnNames": [
"shop_id"
],
"localTableName": "public.sms_logs",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.shops",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"first_name": {
"name": "first_name",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"last_name": {
"name": "last_name",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"phone": {
"name": "phone",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"birth_date": {
"name": "birth_date",
"type": "date",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 0,
"default": "null",
"mappedType": "date"
},
"marriage_date": {
"name": "marriage_date",
"type": "date",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 0,
"default": "null",
"mappedType": "date"
},
"referrer": {
"name": "referrer",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"is_active": {
"name": "is_active",
"type": "boolean",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "true",
"mappedType": "boolean"
},
"gender": {
"name": "gender",
"type": "boolean",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"default": "true",
"mappedType": "boolean"
},
"avatar_url": {
"name": "avatar_url",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
}
},
"name": "users",
"schema": "public",
"indexes": [
{
"columnNames": [
"phone"
],
"composite": false,
"keyName": "users_phone_unique",
"constraint": true,
"primary": false,
"unique": true
},
{
"keyName": "users_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "users_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "users_is_active_index",
"columnNames": [
"is_active"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "users_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"user_id": {
"name": "user_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"shop_id": {
"name": "shop_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"amount": {
"name": "amount",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"mappedType": "decimal"
},
"balance": {
"name": "balance",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"mappedType": "decimal"
},
"type": {
"name": "type",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"enumItems": [],
"mappedType": "enum"
},
"reason": {
"name": "reason",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"enumItems": [
"order_completed_deposit",
"convert_score_to_point"
],
"mappedType": "enum"
}
},
"name": "point_transactions",
"schema": "public",
"indexes": [
{
"keyName": "point_transactions_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "point_transactions_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "point_transactions_shop_id_index",
"columnNames": [
"shop_id"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "point_transactions_user_id_index",
"columnNames": [
"user_id"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "point_transactions_user_id_shop_id_index",
"columnNames": [
"user_id",
"shop_id"
],
"composite": true,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "point_transactions_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"point_transactions_user_id_foreign": {
"constraintName": "point_transactions_user_id_foreign",
"columnNames": [
"user_id"
],
"localTableName": "public.point_transactions",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.users",
"updateRule": "cascade"
},
"point_transactions_shop_id_foreign": {
"constraintName": "point_transactions_shop_id_foreign",
"columnNames": [
"shop_id"
],
"localTableName": "public.point_transactions",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.users",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"user_id": {
"name": "user_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"shop_id": {
"name": "shop_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"delivery_method_id": {
"name": "delivery_method_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"user_address": {
"name": "user_address",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"payment_method_id": {
"name": "payment_method_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"order_number": {
"name": "order_number",
"type": "serial",
"unsigned": true,
"autoincrement": true,
"primary": false,
"nullable": false,
"mappedType": "integer"
},
"coupon_discount": {
"name": "coupon_discount",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"default": "0",
"mappedType": "decimal"
},
"coupon_detail": {
"name": "coupon_detail",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"items_discount": {
"name": "items_discount",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"default": "0",
"mappedType": "decimal"
},
"total_discount": {
"name": "total_discount",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"default": "0",
"mappedType": "decimal"
},
"sub_total": {
"name": "sub_total",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"mappedType": "decimal"
},
"tax": {
"name": "tax",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"default": "0",
"mappedType": "decimal"
},
"delivery_fee": {
"name": "delivery_fee",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"default": "0",
"mappedType": "decimal"
},
"total": {
"name": "total",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"mappedType": "decimal"
},
"total_items": {
"name": "total_items",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "0",
"mappedType": "integer"
},
"description": {
"name": "description",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"status": {
"name": "status",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"enumItems": [
"pendingPayment",
"paid",
"preparing",
"deliveredToRecepient",
"shipped",
"completed",
"canceled"
],
"mappedType": "enum"
},
"history": {
"name": "history",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
}
},
"name": "orders",
"schema": "public",
"indexes": [
{
"keyName": "orders_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "orders_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "orders_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"orders_user_id_foreign": {
"constraintName": "orders_user_id_foreign",
"columnNames": [
"user_id"
],
"localTableName": "public.orders",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.users",
"updateRule": "cascade"
},
"orders_shop_id_foreign": {
"constraintName": "orders_shop_id_foreign",
"columnNames": [
"shop_id"
],
"localTableName": "public.orders",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.shops",
"updateRule": "cascade"
},
"orders_delivery_method_id_foreign": {
"constraintName": "orders_delivery_method_id_foreign",
"columnNames": [
"delivery_method_id"
],
"localTableName": "public.orders",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.deliveries",
"updateRule": "cascade"
},
"orders_payment_method_id_foreign": {
"constraintName": "orders_payment_method_id_foreign",
"columnNames": [
"payment_method_id"
],
"localTableName": "public.orders",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.payment_methods",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"order_id": {
"name": "order_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"product_id": {
"name": "product_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"user_id": {
"name": "user_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"comment": {
"name": "comment",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "text"
},
"rating": {
"name": "rating",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "0",
"mappedType": "integer"
},
"positive_points": {
"name": "positive_points",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"negative_points": {
"name": "negative_points",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"status": {
"name": "status",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "'pending'",
"enumItems": [
"pending",
"rejected",
"approved"
],
"mappedType": "enum"
}
},
"name": "reviews",
"schema": "public",
"indexes": [
{
"keyName": "reviews_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "reviews_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "reviews_order_id_index",
"columnNames": [
"order_id"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "reviews_user_id_index",
"columnNames": [
"user_id"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "reviews_product_id_status_index",
"columnNames": [
"product_id",
"status"
],
"composite": true,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "reviews_order_id_product_id_user_id_unique",
"columnNames": [
"order_id",
"product_id",
"user_id"
],
"composite": true,
"constraint": true,
"primary": false,
"unique": true
},
{
"keyName": "reviews_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"reviews_order_id_foreign": {
"constraintName": "reviews_order_id_foreign",
"columnNames": [
"order_id"
],
"localTableName": "public.reviews",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.orders",
"updateRule": "cascade"
},
"reviews_product_id_foreign": {
"constraintName": "reviews_product_id_foreign",
"columnNames": [
"product_id"
],
"localTableName": "public.reviews",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.products",
"updateRule": "cascade"
},
"reviews_user_id_foreign": {
"constraintName": "reviews_user_id_foreign",
"columnNames": [
"user_id"
],
"localTableName": "public.reviews",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.users",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"order_id": {
"name": "order_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"amount": {
"name": "amount",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"mappedType": "decimal"
},
"reference_id": {
"name": "reference_id",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"method": {
"name": "method",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"enumItems": [
"Online",
"Cash",
"Wallet"
],
"mappedType": "enum"
},
"gateway": {
"name": "gateway",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"enumItems": [
"zarinpal"
],
"mappedType": "enum"
},
"transaction_id": {
"name": "transaction_id",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"status": {
"name": "status",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"enumItems": [
"pending",
"paid",
"failed",
"refunded"
],
"mappedType": "enum"
},
"card_pan": {
"name": "card_pan",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"verify_response": {
"name": "verify_response",
"type": "jsonb",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"mappedType": "json"
},
"paid_at": {
"name": "paid_at",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"failed_at": {
"name": "failed_at",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"description": {
"name": "description",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
}
},
"name": "payments",
"schema": "public",
"indexes": [
{
"columnNames": [
"order_id"
],
"composite": false,
"keyName": "payments_order_id_index",
"constraint": false,
"primary": false,
"unique": false
},
{
"columnNames": [
"reference_id"
],
"composite": false,
"keyName": "payments_reference_id_unique",
"constraint": true,
"primary": false,
"unique": true
},
{
"keyName": "payments_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "payments_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "payments_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"payments_order_id_foreign": {
"constraintName": "payments_order_id_foreign",
"columnNames": [
"order_id"
],
"localTableName": "public.payments",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.orders",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"shop_id": {
"name": "shop_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"user_id": {
"name": "user_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 26,
"mappedType": "character"
},
"admin_id": {
"name": "admin_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 26,
"mappedType": "character"
},
"title": {
"name": "title",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"enumItems": [
"pager.created",
"order.created",
"payment.success",
"review.created",
"order.status.changed"
],
"mappedType": "enum"
},
"content": {
"name": "content",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"seen_at": {
"name": "seen_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
}
},
"name": "notifications",
"schema": "public",
"indexes": [
{
"keyName": "notifications_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "notifications_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "notifications_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"notifications_shop_id_foreign": {
"constraintName": "notifications_shop_id_foreign",
"columnNames": [
"shop_id"
],
"localTableName": "public.notifications",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.shops",
"updateRule": "cascade"
},
"notifications_user_id_foreign": {
"constraintName": "notifications_user_id_foreign",
"columnNames": [
"user_id"
],
"localTableName": "public.notifications",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.users",
"deleteRule": "set null",
"updateRule": "cascade"
},
"notifications_admin_id_foreign": {
"constraintName": "notifications_admin_id_foreign",
"columnNames": [
"admin_id"
],
"localTableName": "public.notifications",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.admins",
"deleteRule": "set null",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"user_id": {
"name": "user_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"product_id": {
"name": "product_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
}
},
"name": "favorites",
"schema": "public",
"indexes": [
{
"keyName": "favorites_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "favorites_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "favorites_user_id_product_id_unique",
"columnNames": [
"user_id",
"product_id"
],
"composite": true,
"constraint": true,
"primary": false,
"unique": true
},
{
"keyName": "favorites_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"favorites_user_id_foreign": {
"constraintName": "favorites_user_id_foreign",
"columnNames": [
"user_id"
],
"localTableName": "public.favorites",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.users",
"updateRule": "cascade"
},
"favorites_product_id_foreign": {
"constraintName": "favorites_product_id_foreign",
"columnNames": [
"product_id"
],
"localTableName": "public.favorites",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.products",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"user_id": {
"name": "user_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"title": {
"name": "title",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"address": {
"name": "address",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"city": {
"name": "city",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"province": {
"name": "province",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"postal_code": {
"name": "postal_code",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"latitude": {
"name": "latitude",
"type": "real",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "float"
},
"longitude": {
"name": "longitude",
"type": "real",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "float"
},
"phone": {
"name": "phone",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 255,
"mappedType": "string"
},
"is_default": {
"name": "is_default",
"type": "boolean",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"default": "false",
"mappedType": "boolean"
}
},
"name": "user_addresses",
"schema": "public",
"indexes": [
{
"keyName": "user_addresses_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "user_addresses_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "user_addresses_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"user_addresses_user_id_foreign": {
"constraintName": "user_addresses_user_id_foreign",
"columnNames": [
"user_id"
],
"localTableName": "public.user_addresses",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.users",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"product_id": {
"name": "product_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"value": {
"name": "value",
"type": "varchar(255)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 255,
"mappedType": "string"
},
"price": {
"name": "price",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"precision": 10,
"scale": 0,
"mappedType": "decimal"
},
"stock": {
"name": "stock",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"default": "null",
"mappedType": "integer"
}
},
"name": "variants",
"schema": "public",
"indexes": [
{
"keyName": "variants_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "variants_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "variants_product_id_index",
"columnNames": [
"product_id"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "variants_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"variants_product_id_foreign": {
"constraintName": "variants_product_id_foreign",
"columnNames": [
"product_id"
],
"localTableName": "public.variants",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.products",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"order_id": {
"name": "order_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"variant_id": {
"name": "variant_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"quantity": {
"name": "quantity",
"type": "int",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"mappedType": "integer"
},
"unit_price": {
"name": "unit_price",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"mappedType": "decimal"
},
"discount": {
"name": "discount",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"default": "0",
"mappedType": "decimal"
},
"total_price": {
"name": "total_price",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"mappedType": "decimal"
}
},
"name": "order_items",
"schema": "public",
"indexes": [
{
"keyName": "order_items_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "order_items_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "order_items_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"order_items_order_id_foreign": {
"constraintName": "order_items_order_id_foreign",
"columnNames": [
"order_id"
],
"localTableName": "public.order_items",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.orders",
"updateRule": "cascade"
},
"order_items_variant_id_foreign": {
"constraintName": "order_items_variant_id_foreign",
"columnNames": [
"variant_id"
],
"localTableName": "public.order_items",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.variants",
"updateRule": "cascade"
}
},
"nativeEnums": {}
},
{
"columns": {
"id": {
"name": "id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"created_at": {
"name": "created_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"deleted_at": {
"name": "deleted_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": true,
"length": 6,
"mappedType": "datetime"
},
"user_id": {
"name": "user_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"shop_id": {
"name": "shop_id",
"type": "char(26)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 26,
"mappedType": "character"
},
"amount": {
"name": "amount",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"mappedType": "decimal"
},
"balance": {
"name": "balance",
"type": "numeric(10,0)",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"precision": 10,
"scale": 0,
"mappedType": "decimal"
},
"type": {
"name": "type",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"enumItems": [
"credit",
"debit"
],
"mappedType": "enum"
},
"reason": {
"name": "reason",
"type": "text",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"enumItems": [
"order_payment",
"order_refund",
"convert_score_to_wallet",
"withdraw",
"deposit"
],
"mappedType": "enum"
}
},
"name": "wallet_transactions",
"schema": "public",
"indexes": [
{
"keyName": "wallet_transactions_created_at_index",
"columnNames": [
"created_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "wallet_transactions_deleted_at_index",
"columnNames": [
"deleted_at"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "wallet_transactions_shop_id_index",
"columnNames": [
"shop_id"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "wallet_transactions_user_id_index",
"columnNames": [
"user_id"
],
"composite": false,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "wallet_transactions_user_id_shop_id_index",
"columnNames": [
"user_id",
"shop_id"
],
"composite": true,
"constraint": false,
"primary": false,
"unique": false
},
{
"keyName": "wallet_transactions_pkey",
"columnNames": [
"id"
],
"composite": false,
"constraint": true,
"primary": true,
"unique": true
}
],
"checks": [],
"foreignKeys": {
"wallet_transactions_user_id_foreign": {
"constraintName": "wallet_transactions_user_id_foreign",
"columnNames": [
"user_id"
],
"localTableName": "public.wallet_transactions",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.users",
"updateRule": "cascade"
},
"wallet_transactions_shop_id_foreign": {
"constraintName": "wallet_transactions_shop_id_foreign",
"columnNames": [
"shop_id"
],
"localTableName": "public.wallet_transactions",
"referencedColumnNames": [
"id"
],
"referencedTableName": "public.shops",
"updateRule": "cascade"
}
},
"nativeEnums": {}
}
],
"nativeEnums": {}
}