summaryrefslogtreecommitdiff
path: root/src/invidious/database/migrations/0007_create_annotations_table.cr
blob: dcecbc3b8a04bcf17eefed3b2739b23e09cf788e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module Invidious::Database::Migrations
  class CreateAnnotationsTable < Migration
    version 7

    def up(conn : DB::Connection)
      conn.exec <<-SQL
      CREATE TABLE IF NOT EXISTS public.annotations
      (
        id text NOT NULL,
        annotations xml,
        CONSTRAINT annotations_id_key UNIQUE (id)
      );
      SQL

      conn.exec <<-SQL
      GRANT ALL ON TABLE public.annotations TO current_user;
      SQL
    end
  end
end