CREATE TABLE IF NOT EXISTS event_logs (
  id integer PRIMARY KEY NOT NULL,
  cruise_id integer,
  trip_id integer,
  day_id integer,
  log_id integer,
  account_id integer NOT NULL,
  ship_id integer,
  user_id integer,
  created_at timestamp with time zone NOT NULL,
  updated_at timestamp with time zone NOT NULL,
  synced_at timestamp with time zone,
  data json NOT NULL DEFAULT '{}',
  info character varying(255) NOT NULL,
  level integer,
  type character varying(255) NOT NULL
);

CREATE INDEX IF NOT EXISTS index_event_logs_on_account_id_ship_id_level_type  ON event_logs (account_id, ship_id, level, type);
INSERT INTO schema_migrations(version) VALUES('20260301165118') ON CONFLICT(version) DO NOTHING;
