diff --git a/.github/linters/.sqlfluff b/.github/linters/.sqlfluff new file mode 100644 index 0000000..75f73ae --- /dev/null +++ b/.github/linters/.sqlfluff @@ -0,0 +1,2 @@ +[sqlfluff] +dialect = mysql diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index df27749..e431d56 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -3,14 +3,7 @@ name: Lint Code Base on: - push: - branches: - - main - pull_request: - branches: - - main - - next jobs: run-lint: @@ -27,3 +20,4 @@ jobs: VALIDATE_ALL_CODEBASE: false DEFAULT_BRANCH: "main" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_SQLFLUFF: false diff --git a/db/rootfs/docker-entrypoint-initdb.d/001_mailserver.sql b/db/rootfs/docker-entrypoint-initdb.d/001_mailserver.sql index 1b8018a..7fe874f 100644 --- a/db/rootfs/docker-entrypoint-initdb.d/001_mailserver.sql +++ b/db/rootfs/docker-entrypoint-initdb.d/001_mailserver.sql @@ -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);