CREATE TABLE calendars (
  id VARCHAR(64) PRIMARY KEY DEFAULT uuid_generate_v4() NOT NULL,
  user_id VARCHAR(64) NOT NULL REFERENCES users(id) ON DELETE CASCADE,
  target_uid VARCHAR(64) NOT NULL,
  name VARCHAR(128),
  description VARCHAR(8000),
  trigger_delete BOOLEAN DEFAULT FALSE,
  start_at TIMESTAMP WITHOUT TIME ZONE NOT NULL,
  end_at TIMESTAMP WITHOUT TIME ZONE NOT NULL,
  recurring_mode VARCHAR(50) NOT NULL DEFAULT 'once',
  created_at TIMESTAMP WITHOUT TIME ZONE DEFAULT NOW() NOT NULL,
  updated_at TIMESTAMP WITHOUT TIME ZONE DEFAULT NOW() NOT NULL
);