feat: add mime column to image table and switch to mysql

This commit is contained in:
b1ek 2024-08-20 12:45:28 +10:00
parent be788c16e8
commit 97e287e731
Signed by: blek
GPG Key ID: 14546221E3595D0C
4 changed files with 49 additions and 7 deletions

View File

@ -3,7 +3,7 @@ services:
image: yiisoftware/yii2-php:8.3-fpm-24.3.0-nginx image: yiisoftware/yii2-php:8.3-fpm-24.3.0-nginx
restart: always restart: always
volumes: volumes:
- ./:/app:delegated - ./:/app
ports: ports:
- '80:80' - '80:80'
networks: networks:
@ -11,18 +11,19 @@ services:
environment: environment:
PHP_ENABLE_XDEBUG: 1 PHP_ENABLE_XDEBUG: 1
XDEBUG_CONFIG: 'client_host=host.docker.internal client_port=9003' XDEBUG_CONFIG: 'client_host=host.docker.internal client_port=9003'
db: db:
image: lscr.io/linuxserver/mariadb:10.11.8 image: mysql:8.0.39-bookworm
restart: always restart: always
volumes: volumes:
- ./volatile/mariadb:/config - ./volatile/db:/var
networks: networks:
bankitest: bankitest:
aliases: aliases:
- db - db
environment: environment:
PUID: 1000 # change me PUID: 1000
PGID: 1000 # change me PGID: 1000
MYSQL_DATABASE: bankitest MYSQL_DATABASE: bankitest
MYSQL_ROOT_PASSWORD: # change me MYSQL_ROOT_PASSWORD: # change me
MYSQL_USER: server MYSQL_USER: server

View File

@ -1,6 +1,6 @@
<?php <?php
use yii\db\cubrid\Schema; use yii\db\mysql\Schema;
use yii\db\Migration; use yii\db\Migration;
/** /**

View File

@ -1,6 +1,6 @@
<?php <?php
use yii\db\cubrid\Schema; use yii\db\mysql\Schema;
use yii\db\Migration; use yii\db\Migration;
/** /**

View File

@ -0,0 +1,41 @@
<?php
use yii\db\Migration;
use yii\db\mysql\Schema;
/**
* Class m240820_024046_add_mime_to_image
*/
class m240820_024046_add_mime_to_image extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->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;
}
*/
}