init push

This commit is contained in:
2026-07-16 22:16:45 +07:00
commit 8b068bdb10
1021 changed files with 332816 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
-- +goose Up
SET @bases_exists := (
SELECT COUNT(*)
FROM information_schema.tables
WHERE table_schema = DATABASE()
AND table_name = 'bases'
);
SET @col_default_shift_time_exists := (
SELECT COUNT(*)
FROM information_schema.columns
WHERE table_schema = DATABASE()
AND table_name = 'bases'
AND column_name = 'default_shift_time'
);
SET @drop_default_shift_time_sql := IF(
@bases_exists > 0 AND @col_default_shift_time_exists > 0,
'ALTER TABLE bases DROP COLUMN default_shift_time',
'SELECT 1'
);
PREPARE stmt_drop_default_shift_time FROM @drop_default_shift_time_sql;
EXECUTE stmt_drop_default_shift_time;
DEALLOCATE PREPARE stmt_drop_default_shift_time;
-- +goose Down
SET @bases_exists := (
SELECT COUNT(*)
FROM information_schema.tables
WHERE table_schema = DATABASE()
AND table_name = 'bases'
);
SET @col_default_shift_time_exists := (
SELECT COUNT(*)
FROM information_schema.columns
WHERE table_schema = DATABASE()
AND table_name = 'bases'
AND column_name = 'default_shift_time'
);
SET @add_default_shift_time_sql := IF(
@bases_exists > 0 AND @col_default_shift_time_exists = 0,
'ALTER TABLE bases ADD COLUMN default_shift_time VARCHAR(64) NULL AFTER default_shift_end',
'SELECT 1'
);
PREPARE stmt_add_default_shift_time FROM @add_default_shift_time_sql;
EXECUTE stmt_add_default_shift_time;
DEALLOCATE PREPARE stmt_add_default_shift_time;