mirror of
https://github.com/cf-sonr/motr.git
synced 2026-01-12 02:59:13 +00:00
* feat: enhance modularity by relocating core packages * refactor: move chart components to dashboard package * refactor: restructure database access layer * refactor: rename credential descriptor to credentials for clarity * feat: enhance development environment configuration for database interactions * feat: integrate go-task for database migrations * feat: introduce middleware for market data and WebAuthn
22 lines
639 B
SQL
22 lines
639 B
SQL
-- Assets represent tokens and coins
|
|
CREATE TABLE assets (
|
|
id TEXT PRIMARY KEY,
|
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
deleted_at TIMESTAMP,
|
|
name TEXT NOT NULL,
|
|
symbol TEXT NOT NULL,
|
|
decimals INTEGER NOT NULL CHECK(decimals >= 0),
|
|
chain_id TEXT NOT NULL,
|
|
channel TEXT NOT NULL,
|
|
asset_type TEXT NOT NULL,
|
|
coingecko_id TEXT,
|
|
UNIQUE(chain_id, symbol)
|
|
);
|
|
|
|
CREATE INDEX idx_assets_symbol ON assets(symbol);
|
|
CREATE INDEX idx_assets_chain_id ON assets(chain_id);
|
|
CREATE INDEX idx_assets_deleted_at ON assets(deleted_at);
|
|
|
|
|