-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: provide a fully migrated database dump (#295)
- Loading branch information
Showing
3 changed files
with
53 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[sqlfluff] | ||
dialect = mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 50 additions & 70 deletions
120
db/rootfs/docker-entrypoint-initdb.d/001_mailserver.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,62 @@ | ||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | ||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | ||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | ||
/*!40101 SET NAMES utf8 */; | ||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; | ||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; | ||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; | ||
|
||
|
||
# Export von Tabelle mail_aliases | ||
# ------------------------------------------------------------ | ||
SET NAMES utf8mb4; | ||
SET FOREIGN_KEY_CHECKS = 0; | ||
|
||
DROP TABLE IF EXISTS `mail_aliases`; | ||
|
||
CREATE TABLE `mail_aliases` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`domain_id` int(11) DEFAULT NULL, | ||
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | ||
`destination` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE KEY `alias_idx` (`domain_id`,`name`,`destination`), | ||
KEY `IDX_85AF3A56115F0EE5` (`domain_id`), | ||
CONSTRAINT `FK_5F12BB39115F0EE5` FOREIGN KEY (`domain_id`) REFERENCES `mail_domains` (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | ||
|
||
# Export von Tabelle mail_domains | ||
# ------------------------------------------------------------ | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`domain_id` int(11) DEFAULT NULL, | ||
`name` varchar(255) NOT NULL, | ||
`destination` varchar(255) NOT NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE KEY `alias_idx` (`domain_id`, `name`, `destination`), | ||
KEY `IDX_85AF3A56115F0EE5` (`domain_id`), | ||
CONSTRAINT `FK_5F12BB39115F0EE5` FOREIGN KEY ( | ||
`domain_id` | ||
) REFERENCES `mail_domains` (`id`) | ||
) ENGINE = InnoDB; | ||
|
||
DROP TABLE IF EXISTS `mail_domains`; | ||
|
||
CREATE TABLE `mail_domains` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE KEY `UNIQ_56C63EF25E237E06` (`name`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
# Export von Tabelle mail_users | ||
# ------------------------------------------------------------ | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`name` varchar(255) NOT NULL, | ||
`dkim_enabled` tinyint(1) NOT NULL, | ||
`dkim_selector` varchar(255) NOT NULL, | ||
`dkim_private_key` longtext NOT NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE KEY `UNIQ_56C63EF25E237E06` (`name`) | ||
) ENGINE = InnoDB; | ||
|
||
DROP TABLE IF EXISTS `mail_users`; | ||
|
||
CREATE TABLE `mail_users` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`domain_id` int(11) DEFAULT NULL, | ||
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | ||
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE KEY `user_idx` (`name`,`domain_id`), | ||
KEY `IDX_20400786115F0EE5` (`domain_id`), | ||
CONSTRAINT `FK_1483A5E9115F0EE5` FOREIGN KEY (`domain_id`) REFERENCES `mail_domains` (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | ||
|
||
# Export von Tabelle migration_versions | ||
# ------------------------------------------------------------ | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`domain_id` int(11) DEFAULT NULL, | ||
`name` varchar(255) NOT NULL, | ||
`password` varchar(255) NOT NULL, | ||
`admin` tinyint(1) NOT NULL, | ||
`enabled` tinyint(1) NOT NULL, | ||
`send_only` tinyint(1) NOT NULL, | ||
`quota` int(11) NOT NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE KEY `user_idx` (`name`, `domain_id`), | ||
KEY `IDX_20400786115F0EE5` (`domain_id`), | ||
CONSTRAINT `FK_1483A5E9115F0EE5` FOREIGN KEY ( | ||
`domain_id` | ||
) REFERENCES `mail_domains` (`id`) | ||
) ENGINE = InnoDB; | ||
|
||
DROP TABLE IF EXISTS `migration_versions`; | ||
|
||
CREATE TABLE `migration_versions` ( | ||
`version` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | ||
PRIMARY KEY (`version`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | ||
|
||
LOCK TABLES `migration_versions` WRITE; | ||
/*!40000 ALTER TABLE `migration_versions` DISABLE KEYS */; | ||
|
||
INSERT INTO `migration_versions` (`version`) | ||
VALUES | ||
('20180320164351'), | ||
('20180320171339'); | ||
|
||
/*!40000 ALTER TABLE `migration_versions` ENABLE KEYS */; | ||
UNLOCK TABLES; | ||
|
||
|
||
|
||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | ||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | ||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | ||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | ||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | ||
`version` varchar(191) NOT NULL, | ||
`executed_at` DATETIME DEFAULT NULL, | ||
`execution_time` int(11) DEFAULT NULL, | ||
PRIMARY KEY (`version`) | ||
) ENGINE = InnoDB; | ||
|
||
INSERT INTO `migration_versions` ( | ||
`version`, `executed_at`, `execution_time` | ||
) VALUES | ||
('DoctrineMigrations\\Version20180320164351', NOW(), 0), | ||
('DoctrineMigrations\\Version20180320171339', NOW(), 0), | ||
('DoctrineMigrations\\Version20180322081734', NOW(), 0), | ||
('DoctrineMigrations\\Version20180520173959', NOW(), 0), | ||
('DoctrineMigrations\\Version20190610121554', NOW(), 0); |