From 97e287e7318533d479f7d317155fdbd49101466e Mon Sep 17 00:00:00 2001 From: b1ek Date: Tue, 20 Aug 2024 12:45:28 +1000 Subject: [PATCH] feat: add mime column to image table and switch to mysql --- docker-compose.yml.template | 11 ++--- migrations/m240819_084542_parameters.php | 2 +- migrations/m240819_102301_image.php | 2 +- .../m240820_024046_add_mime_to_image.php | 41 +++++++++++++++++++ 4 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 migrations/m240820_024046_add_mime_to_image.php diff --git a/docker-compose.yml.template b/docker-compose.yml.template index 4aef89c..29870a8 100644 --- a/docker-compose.yml.template +++ b/docker-compose.yml.template @@ -3,7 +3,7 @@ services: image: yiisoftware/yii2-php:8.3-fpm-24.3.0-nginx restart: always volumes: - - ./:/app:delegated + - ./:/app ports: - '80:80' networks: @@ -11,18 +11,19 @@ services: environment: PHP_ENABLE_XDEBUG: 1 XDEBUG_CONFIG: 'client_host=host.docker.internal client_port=9003' + db: - image: lscr.io/linuxserver/mariadb:10.11.8 + image: mysql:8.0.39-bookworm restart: always volumes: - - ./volatile/mariadb:/config + - ./volatile/db:/var networks: bankitest: aliases: - db environment: - PUID: 1000 # change me - PGID: 1000 # change me + PUID: 1000 + PGID: 1000 MYSQL_DATABASE: bankitest MYSQL_ROOT_PASSWORD: # change me MYSQL_USER: server diff --git a/migrations/m240819_084542_parameters.php b/migrations/m240819_084542_parameters.php index c3ea02c..8dde0f5 100644 --- a/migrations/m240819_084542_parameters.php +++ b/migrations/m240819_084542_parameters.php @@ -1,6 +1,6 @@ addColumn('image', 'mime', Schema::TYPE_STRING . ' NOT NULL'); + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + $this->dropColumn('table', 'mime'); + } + + /* + // Use up()/down() to run migration code without a transaction. + public function up() + { + + } + + public function down() + { + echo "m240820_024046_add_mime_to_image cannot be reverted.\n"; + + return false; + } + */ +}