Files
cgrates/data/storage/postgres/create_cdrs_tables.sql
2023-12-12 10:09:18 +01:00

16 lines
380 B
SQL

--
-- Table structure for table `cdrs`
--
DROP TABLE IF EXISTS cdrs;
CREATE TABLE cdrs (
id SERIAL PRIMARY KEY,
tenant VARCHAR(40) NOT NULL,
opts jsonb NOT NULL,
event jsonb NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE NULL,
deleted_at TIMESTAMP WITH TIME ZONE NULL
);
CREATE UNIQUE INDEX opts_cdrid_idx ON cdrs( (opts->>'*cdrID') );