增加群组创建、邀请与成员权限管理

This commit is contained in:
xhgit committed 2026-11-14 08:20:47 +08:00
1 parent b1f55df263
commit 99a741e6da
13 files changed
+620 -5

No files matched your search

+4 -1
View File
@@ -25,6 +25,9 @@ var mlsCredentialsMigration string
//go:embed 006_attachments.sql
var attachmentsMigration string
//go:embed 007_groups.sql
var groupsMigration string
func Migrate(ctx context.Context, pool *pgxpool.Pool) error {
tx, err := pool.Begin(ctx)
if err != nil {
@@ -37,7 +40,7 @@ func Migrate(ctx context.Context, pool *pgxpool.Pool) error {
if _, err = tx.Exec(ctx, "CREATE TABLE IF NOT EXISTS schema_migrations (version integer PRIMARY KEY)"); err != nil {
return err
}
for index, migration := range []string{identityMigration, contactsMigration, deliveryMigration, keyPackagesMigration, mlsCredentialsMigration, attachmentsMigration} {
for index, migration := range []string{identityMigration, contactsMigration, deliveryMigration, keyPackagesMigration, mlsCredentialsMigration, attachmentsMigration, groupsMigration} {
version := index + 1
var applied bool
if err = tx.QueryRow(ctx, "SELECT EXISTS (SELECT 1 FROM schema_migrations WHERE version=$1)", version).Scan(&applied); err != nil {