sqlite: fix columns like subreddit name to be case insensitive

This commit is contained in:
Tigor Hutasuhut 2024-05-04 22:17:10 +07:00
parent c3ba228130
commit e7473563ac
5 changed files with 7 additions and 7 deletions

View file

@ -1,7 +1,7 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE subreddits (
name VARCHAR(30) NOT NULL PRIMARY KEY,
name VARCHAR(30) NOT NULL PRIMARY KEY COLLATE NOCASE,
enable_schedule INT NOT NULL DEFAULT 1,
subtype INT NOT NULL DEFAULT 0,
schedule VARCHAR(20) NOT NULL DEFAULT '@daily',

View file

@ -1,9 +1,9 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE devices(
slug VARCHAR(255) NOT NULL PRIMARY KEY,
slug VARCHAR(255) NOT NULL PRIMARY KEY COLLATE NOCASE,
enable INTEGER NOT NULL DEFAULT 1,
name VARCHAR(255) NOT NULL,
name VARCHAR(255) NOT NULL COLLATE NOCASE,
resolution_x DOUBLE NOT NULL,
resolution_y DOUBLE NOT NULL,
aspect_ratio_tolerance DOUBLE NOT NULL default 0.2,

View file

@ -2,8 +2,8 @@
-- +goose StatementBegin
CREATE TABLE images(
id INTEGER PRIMARY KEY,
subreddit VARCHAR(255) NOT NULL,
device VARCHAR(250) NOT NULL,
subreddit VARCHAR(255) NOT NULL COLLATE NOCASE,
device VARCHAR(250) NOT NULL COLLATE NOCASE,
post_title VARCHAR(255) NOT NULL,
post_name VARCHAR(255) NOT NULL,
post_url VARCHAR(255) NOT NULL,

View file

@ -2,7 +2,7 @@
-- +goose StatementBegin
CREATE TABLE schedule_status(
id INTEGER PRIMARY KEY,
subreddit VARCHAR(255) NOT NULL,
subreddit VARCHAR(255) NOT NULL COLLATE NOCASE,
status TINYINT NOT NULL DEFAULT 0,
error_message VARCHAR(255) NOT NULL DEFAULT '',
created_at BIGINT DEFAULT 0 NOT NULL,

View file

@ -2,7 +2,7 @@
-- +goose StatementBegin
CREATE TABLE schedule_histories(
id INTEGER PRIMARY KEY AUTOINCREMENT,
subreddit VARCHAR(255) NOT NULL,
subreddit VARCHAR(255) NOT NULL COLLATE NOCASE,
status TINYINT NOT NULL DEFAULT 0,
error_message VARCHAR(255) NOT NULL DEFAULT '',
created_at BIGINT DEFAULT 0 NOT NULL,