Add unique key on actor preferredUsername
authorChocobozzz <me@florianbigard.com>
Mon, 11 May 2020 09:06:12 +0000 (11:06 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 11 May 2020 09:06:12 +0000 (11:06 +0200)
server/models/activitypub/actor.ts

index e547d2c0c19b00cfd932d318bf4e492675c96e64..34bc917061749571b3a89d3e989e5bf02b206822 100644 (file)
@@ -123,13 +123,13 @@ export const unusedActorAttributesForAPI = [
         }
       }
     },
-    // {
-    //   fields: [ 'preferredUsername' ],
-    //   unique: true,
-    //   where: {
-    //     serverId: null
-    //   }
-    // },
+    {
+      fields: [ 'preferredUsername' ],
+      unique: true,
+      where: {
+        serverId: null
+      }
+    },
     {
       fields: [ 'inboxUrl', 'sharedInboxUrl' ]
     },