feat: add mime column to image table and switch to mysql
This commit is contained in:
parent
be788c16e8
commit
97e287e731
|
@ -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
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use yii\db\cubrid\Schema;
|
use yii\db\mysql\Schema;
|
||||||
use yii\db\Migration;
|
use yii\db\Migration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use yii\db\cubrid\Schema;
|
use yii\db\mysql\Schema;
|
||||||
use yii\db\Migration;
|
use yii\db\Migration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
Loading…
Reference in New Issue