main

mattermost/focalboard

Last updated at: 29/12/2023 09:47

000020_populate_category_blocks.up.sql

TLDR

This SQL file creates a table called category_boards with several columns and sets the primary key. It also adds an index on the category_id column.

CREATE TABLE IF NOT EXISTS {{.prefix}}category_boards (
    id varchar(36) NOT NULL,
    user_id varchar(36) NOT NULL,
    category_id varchar(36) NOT NULL,
    board_id VARCHAR(36) NOT NULL,
    create_at BIGINT,
    update_at BIGINT,
    delete_at BIGINT,
    PRIMARY KEY (id)
) {{if .mysql}}DEFAULT CHARACTER SET utf8mb4{{end}};

{{- /* createIndexIfNeeded tableName columns */ -}}
{{ createIndexIfNeeded "category_boards" "category_id" }}