CREATE TABLE courses (
  id TEXT PRIMARY KEY,
  external_id TEXT,
  source_type TEXT NOT NULL,
  source_name TEXT,
  course_thematic TEXT NOT NULL,
  learning_type TEXT NOT NULL,
  organization_id TEXT NOT NULL,
  origin_link TEXT NOT NULL,
  image_link TEXT,
  name TEXT NOT NULL,
  description TEXT NOT NULL,
  full_price REAL NOT NULL,
  discount REAL NOT NULL,
  duration INTEGER NOT NULL,
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  starts_at DATETIME,
  updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
  deleted_at DATETIME
);

CREATE INDEX idx_course_thematic ON courses (course_thematic);
CREATE INDEX idx_learning_type ON courses (learning_type);
CREATE INDEX idx_organization_id ON courses (organization_id);
