diff --git a/db/migrations/20190202114345_create_announcements_authors.js b/db/migrations/20190202114345_create_announcements_authors.js
index cbc58e4da35d929d3b2d4850c831b378396bf547..e3c8ee1b3c6a23a39d15b9bc59da00a0be2b23d3 100644
--- a/db/migrations/20190202114345_create_announcements_authors.js
+++ b/db/migrations/20190202114345_create_announcements_authors.js
@@ -7,7 +7,7 @@ exports.up = function (knex, Promise) {
             .references('mid').inTable('messages_announcements')
             .onDelete('CASCADE'); //if announcement is deleted, also delete authors
 
-        table.integer('gid').notNullable()
+        table.string('gid', 128).notNullable()
             .references('gid').inTable('groups')
             .onDelete('CASCADE'); //if group is deleted, also delete authors
     });
diff --git a/db/migrations/20190202114346_create_announcements_recipients.js b/db/migrations/20190202114346_create_announcements_recipients.js
index db72ec692151a9c969a41071aaddaaa2e3d8dc0e..dc30eab645076009cc7e49a780307b4925a01f72 100644
--- a/db/migrations/20190202114346_create_announcements_recipients.js
+++ b/db/migrations/20190202114346_create_announcements_recipients.js
@@ -7,7 +7,7 @@ exports.up = function (knex, Promise) {
             .references('mid').inTable('messages_announcements')
             .onDelete('CASCADE'); //if announcement is deleted, also delete recipients
 
-        table.integer('gid').notNullable()
+        table.string('gid', 128).notNullable()
             .references('gid').inTable('groups')
             .onDelete('CASCADE'); //if group is deleted, also delete recipient
     });
diff --git a/db/migrations/20190202114347_create_events_authors.js b/db/migrations/20190202114347_create_events_authors.js
index 904d67ebce9082d712d1c8a4d5e79b2095f65100..1619ccacf96cabe2725d4d92cce5bddc0099267c 100644
--- a/db/migrations/20190202114347_create_events_authors.js
+++ b/db/migrations/20190202114347_create_events_authors.js
@@ -7,7 +7,7 @@ exports.up = function (knex, Promise) {
             .references('mid').inTable('messages_events')
             .onDelete('CASCADE'); //if event is deleted, also delete authors
 
-        table.integer('gid').notNullable()
+        table.string('gid', 128).notNullable()
             .references('gid').inTable('groups')
             .onDelete('CASCADE'); //if group is deleted, also delete authors
     });
diff --git a/db/migrations/20190202114348_create_events_recipients.js b/db/migrations/20190202114348_create_events_recipients.js
index 762a3f0338b071541e5cc2e53f4940986e84c5d8..fc8a157b18e50f7ac68d6a2334581e356d5c1b89 100644
--- a/db/migrations/20190202114348_create_events_recipients.js
+++ b/db/migrations/20190202114348_create_events_recipients.js
@@ -7,7 +7,7 @@ exports.up = function (knex, Promise) {
             .references('mid').inTable('messages_events')
             .onDelete('CASCADE'); //if event is deleted, also delete recipients
 
-        table.integer('gid').notNullable()
+        table.string('gid', 128).notNullable()
             .references('gid').inTable('groups')
             .onDelete('CASCADE'); //if group is deleted, also delete recipient
     });