232 lines
5.5 KiB
JSON
232 lines
5.5 KiB
JSON
{
|
|
"id": "18d8b1e1-2700-4d54-adf8-493d526d5bf5",
|
|
"prevId": "efb1ef58-df53-4e36-b691-ee9811c3ab36",
|
|
"version": "7",
|
|
"dialect": "postgresql",
|
|
"tables": {
|
|
"public.assets": {
|
|
"name": "assets",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"symbol": {
|
|
"name": "symbol",
|
|
"type": "varchar(20)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"type": {
|
|
"name": "type",
|
|
"type": "asset_type_enum",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"base_currency": {
|
|
"name": "base_currency",
|
|
"type": "varchar(10)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"assets_symbol_unique": {
|
|
"name": "assets_symbol_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"symbol"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.transactions": {
|
|
"name": "transactions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"asset_id": {
|
|
"name": "asset_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"tx_type": {
|
|
"name": "tx_type",
|
|
"type": "transaction_type_enum",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"quantity": {
|
|
"name": "quantity",
|
|
"type": "numeric(36, 18)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"price": {
|
|
"name": "price",
|
|
"type": "numeric(36, 18)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"fee": {
|
|
"name": "fee",
|
|
"type": "numeric(36, 18)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'0'"
|
|
},
|
|
"tx_currency": {
|
|
"name": "tx_currency",
|
|
"type": "varchar(10)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"exchange_rate": {
|
|
"name": "exchange_rate",
|
|
"type": "numeric(20, 8)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'1'"
|
|
},
|
|
"executed_at": {
|
|
"name": "executed_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"transactions_asset_id_assets_id_fk": {
|
|
"name": "transactions_asset_id_assets_id_fk",
|
|
"tableFrom": "transactions",
|
|
"tableTo": "assets",
|
|
"columnsFrom": [
|
|
"asset_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "no action",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.users": {
|
|
"name": "users",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"username": {
|
|
"name": "username",
|
|
"type": "varchar(50)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"password_hash": {
|
|
"name": "password_hash",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"users_username_unique": {
|
|
"name": "users_username_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": [
|
|
"username"
|
|
]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
}
|
|
},
|
|
"enums": {
|
|
"public.asset_type_enum": {
|
|
"name": "asset_type_enum",
|
|
"schema": "public",
|
|
"values": [
|
|
"STOCK",
|
|
"CRYPTO",
|
|
"CASH"
|
|
]
|
|
},
|
|
"public.transaction_type_enum": {
|
|
"name": "transaction_type_enum",
|
|
"schema": "public",
|
|
"values": [
|
|
"BUY",
|
|
"SELL",
|
|
"DIVIDEND",
|
|
"AIRDROP",
|
|
"FEE"
|
|
]
|
|
}
|
|
},
|
|
"schemas": {},
|
|
"sequences": {},
|
|
"roles": {},
|
|
"policies": {},
|
|
"views": {},
|
|
"_meta": {
|
|
"columns": {},
|
|
"schemas": {},
|
|
"tables": {}
|
|
}
|
|
} |