diff --git a/patches/patch20221122-6.0-SNAPSHOT/create_entity_ids_table.sql b/patches/patch20221122-6.0-SNAPSHOT/create_entity_ids_table.sql
index ddd1ad1620873ca262d6f23fe5f9de1d7260919f..5b07ce82d89619149ac615aeccd69747b2f55418 100644
--- a/patches/patch20221122-6.0-SNAPSHOT/create_entity_ids_table.sql
+++ b/patches/patch20221122-6.0-SNAPSHOT/create_entity_ids_table.sql
@@ -5,6 +5,8 @@ DROP PROCEDURE IF EXISTS retrieveGroup;
 DROP PROCEDURE IF EXISTS getInfo;
 DROP PROCEDURE IF EXISTS getRole;
 DROP PROCEDURE IF EXISTS setPassword;
+DROP PROCEDURE IF EXISTS initAutoIncrement;
+DELETE FROM entities WHERE id=99;
 
 
 -- new entity_ids table
@@ -17,4 +19,10 @@ CREATE TABLE `entity_ids` (
 ) ENGINE=InnoDB;
 
 -- fill all existing entities into the new entity_ids table.
-INSERT INTO entity_ids (id, internal_id) SELECT id, id FROM entities WHERE id>0 AND role!="DOMAIN";
+INSERT INTO entity_ids (id, internal_id) SELECT id, id FROM entities WHERE id>0 AND role!="DOMAIN" AND id!=50;
+
+ALTER TABLE transaction_log MODIFY COLUMN `entity_id` VARCHAR(255) NOT NULL;
+
+ALTER TABLE user_info DROP CONSTRAINT `subjects_ibfk_1`;
+ALTER TABle user_info MODIFY COLUMN `entity` VARCHAR(255) DEFAULT NULL;
+ALTER TABLE user_info ADD CONSTRAINT `subjects_ibfk_2` FOREIGN KEY (`entity`) REFERENCES `entity_ids` (`id`);
diff --git a/procedures/initAutoIncrement.sql b/procedures/initAutoIncrement.sql
deleted file mode 100644
index 54cb54525ee7d8b864c1e979dfda6ab9471fcfb5..0000000000000000000000000000000000000000
--- a/procedures/initAutoIncrement.sql
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * ** header v3.0
- * This file is a part of the CaosDB Project.
- *
- * Copyright (C) 2018 Research Group Biomedical Physics,
- * Max-Planck-Institute for Dynamics and Self-Organization Göttingen
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- * ** end header
- */
-
-DROP PROCEDURE IF EXISTS db_5_0.initAutoIncrement;
-delimiter //
-
-CREATE PROCEDURE db_5_0.initAutoIncrement()
-BEGIN
-
-    SELECT @max := MAX(entity_id)+ 1 FROM transaction_log; 
-    IF @max IS NOT NULL THEN
-        SET @stmtStr = CONCAT('ALTER TABLE entities AUTO_INCREMENT=',@max);
-        PREPARE stmt FROM @stmtStr;
-        EXECUTE stmt;
-        DEALLOCATE PREPARE stmt;
-    END IF;
-
-END;
-//
-delimiter ;