dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

32.sql (522B)


      1 -- +migrate Up
      2 CREATE TABLE IF NOT EXISTS audit_logs (
      3     id INTEGER NOT NULL PRIMARY KEY,
      4     user_id INTEGER NOT NULL,
      5     log VARCHAR(255) NOT NULL,
      6     created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
      7     CONSTRAINT audit_logs_user_id_fk
      8         FOREIGN KEY (user_id)
      9             REFERENCES users (id)
     10             ON DELETE CASCADE
     11             ON UPDATE CASCADE);
     12 CREATE INDEX audit_logs_user_id_idx ON audit_logs (user_id);
     13 CREATE INDEX audit_logs_created_at_idx ON audit_logs (created_at);
     14 
     15 -- +migrate Down