Ente CommunityEC
Ente Community6mo ago
39 replies
Dylanger

Migration Failed

{"file":"main.go:899","func":"setupDatabase","level":"panic","msg":"migration failed: syntax error at or near "TRIGGER" (column 19) in line 23: \n\nCREATE TABLE IF NOT EXISTS public_file_tokens\n(\n id text primary key,\n file_id bigint NOT NULL,\n owner_id bigint NOT NULL,\n app text NOT NULL,\n access_token text not null,\n valid_till bigint not null DEFAULT 0,\n device_limit int not null DEFAULT 0,\n is_disabled bool not null DEFAULT FALSE,\n enable_download bool not null DEFAULT TRUE,\n pw_hash TEXT,\n pw_nonce TEXT,\n mem_limit BIGINT,\n ops_limit BIGINT,\n created_at bigint NOT NULL DEFAULT now_utc_micro_seconds(),\n updated_at bigint NOT NULL DEFAULT now_utc_micro_seconds()\n);\n\n\nCREATE OR REPLACE TRIGGER update_public_file_tokens_updated_at\n BEFORE UPDATE\n ON public_file_tokens\n FOR EACH ROW\nEXECUTE PROCEDURE\n trigger_updated_at_microseconds_column();\n\n\nCREATE TABLE IF NOT EXISTS public_file_tokens_access_history\n(\n id text NOT NULL,\n ip text not null,\n user_agent text not null,\n created_at bigint NOT NULL DEFAULT now_utc_micro_seconds(),\n CONSTRAINT unique_access_id_ip_ua UNIQUE (id, ip, user_agent),\n CONSTRAINT fk_public_file_history_token_id\n FOREIGN KEY (id)\n REFERENCES public_file_tokens (id)\n ON DELETE CASCADE\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS public_file_token_unique_idx ON public_file_tokens (access_token) WHERE is_disabled = FALSE;\nCREATE INDEX IF NOT EXISTS public_file_tokens_owner_id_updated_at_idx ON public_file_tokens (owner_id, updated_at);\nCREATE UNIQUE INDEX IF NOT EXISTS public_active_file_link_unique_idx ON public_file_tokens (file_id, is_disabled) WHERE is_disabled = FALSE;\n (details: pq: syntax error at or near "TRIGGER")","time":"2025-08-09T14:47:20Z"}
Was this page helpful?