mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-14 12:02:27 +08:00
19 lines
564 B
Go
19 lines
564 B
Go
package migrations
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestContentModerationEngineMetaMigration(t *testing.T) {
|
|
raw, err := FS.ReadFile("238b_content_moderation_engine_meta.sql")
|
|
require.NoError(t, err)
|
|
sql := strings.ToUpper(string(raw))
|
|
require.Contains(t, sql, "ALTER TABLE CONTENT_MODERATION_LOGS ADD COLUMN IF NOT EXISTS ENGINE_META JSONB;")
|
|
for _, disallowed := range []string{"NOT NULL", "DEFAULT", "CHECK (", "DROP COLUMN", "UPDATE CONTENT_MODERATION_LOGS"} {
|
|
require.NotContains(t, sql, disallowed)
|
|
}
|
|
}
|