fix(db): resolve migration bugs preventing fresh database initialization

- Fix composite primary keys in role_permissions and user_roles tables
  (PostgreSQL does not allow multiple PRIMARY KEY constraints)
- Fix FK table name mismatch: tasks → tokens (was wf_tokens)
- Fix FK table name mismatch: messages → message_templates (was message_templates_ref)
- Fix tenant table name in main.rs SQL: tenant (not tenants)
- Fix React Router nested routes: add /* wildcard for child route matching
This commit is contained in:
iven
2026-04-12 16:58:47 +08:00
parent 3b41e73f82
commit 9557c9ca16
6 changed files with 21 additions and 31 deletions

View File

@@ -93,7 +93,7 @@ impl MigrationTrait for Migration {
ForeignKey::create()
.name("fk_messages_template")
.from(Messages::Table, Messages::TemplateId)
.to(MessageTemplatesRef::Table, MessageTemplatesRef::Id)
.to(MessageTemplates::Table, MessageTemplates::Id)
.to_owned(),
)
.await?;
@@ -137,7 +137,7 @@ enum Messages {
}
#[derive(DeriveIden)]
enum MessageTemplatesRef {
enum MessageTemplates {
Table,
Id,
}