1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2024-11-26 21:25:18 +01:00

Switch VARCHAR(N) to TEXT, as they are equivalent in SQLite

This commit is contained in:
Philipp Heckel 2021-12-31 16:19:41 +01:00
parent 7b37141e07
commit 595ea87465

View file

@ -15,13 +15,13 @@ const (
createMessagesTableQuery = ` createMessagesTableQuery = `
BEGIN; BEGIN;
CREATE TABLE IF NOT EXISTS messages ( CREATE TABLE IF NOT EXISTS messages (
id VARCHAR(20) PRIMARY KEY, id TEXT PRIMARY KEY,
time INT NOT NULL, time INT NOT NULL,
topic VARCHAR(64) NOT NULL, topic TEXT NOT NULL,
message VARCHAR(512) NOT NULL, message TEXT NOT NULL,
title VARCHAR(256) NOT NULL, title TEXT NOT NULL,
priority INT NOT NULL, priority INT NOT NULL,
tags VARCHAR(256) NOT NULL, tags TEXT NOT NULL,
published INT NOT NULL published INT NOT NULL
); );
CREATE INDEX IF NOT EXISTS idx_topic ON messages (topic); CREATE INDEX IF NOT EXISTS idx_topic ON messages (topic);
@ -68,9 +68,9 @@ const (
// 0 -> 1 // 0 -> 1
migrate0To1AlterMessagesTableQuery = ` migrate0To1AlterMessagesTableQuery = `
BEGIN; BEGIN;
ALTER TABLE messages ADD COLUMN title VARCHAR(256) NOT NULL DEFAULT(''); ALTER TABLE messages ADD COLUMN title TEXT NOT NULL DEFAULT('');
ALTER TABLE messages ADD COLUMN priority INT NOT NULL DEFAULT(0); ALTER TABLE messages ADD COLUMN priority INT NOT NULL DEFAULT(0);
ALTER TABLE messages ADD COLUMN tags VARCHAR(256) NOT NULL DEFAULT(''); ALTER TABLE messages ADD COLUMN tags TEXT NOT NULL DEFAULT('');
COMMIT; COMMIT;
` `