Files
motr/internal/migrate/013_fear_greed_index_table.up.sql
Prad Nukala 786fef8399 Implement Database Migrations (#12)
* 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
2025-05-29 15:07:20 -04:00

16 lines
609 B
SQL

-- Fear and Greed Index data from Alternative.me
CREATE TABLE fear_greed_index (
id TEXT PRIMARY KEY,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
deleted_at TIMESTAMP,
value INTEGER NOT NULL,
value_classification TEXT NOT NULL,
timestamp TIMESTAMP NOT NULL,
time_until_update TEXT
);
CREATE INDEX idx_fear_greed_index_timestamp ON fear_greed_index(timestamp);
CREATE INDEX idx_fear_greed_index_value ON fear_greed_index(value);
CREATE INDEX idx_fear_greed_index_deleted_at ON fear_greed_index(deleted_at);