diff --git a/Readme.md b/Readme.md index 68e386f..600cbc2 100644 --- a/Readme.md +++ b/Readme.md @@ -3,12 +3,6 @@ ``` bash $ cp .env.dist .env - -# Debemos indicar las variables de entorno - root_pwd=my-super-secret - db_name=api_platform - db_user=root - db_password= ``` #### Docker: Levantamos los servicios y comandos de interes diff --git a/docker/app/docker-entrypoint.sh b/docker/app/docker-entrypoint.sh index c9d7e67..d58ebb0 100755 --- a/docker/app/docker-entrypoint.sh +++ b/docker/app/docker-entrypoint.sh @@ -25,7 +25,6 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'bin/console' ]; then elif [ "$APP_ENV" != 'prod' ]; then # Always try to reinstall deps when not in prod composer install --prefer-dist --no-progress --no-suggest --no-interaction - php bin/console make:migration --no-interaction --no-debug --env="${APP_ENV}" php bin/console doctrine:database:create --if-not-exists --no-interaction --no-debug --env="${APP_ENV}" php bin/console doctrine:migrations:migrate --allow-no-migration --no-interaction --no-debug --env="${APP_ENV}" fi diff --git a/src/Migrations/Version20200519181249.php b/src/Migrations/Version20200519181249.php new file mode 100644 index 0000000..a24365f --- /dev/null +++ b/src/Migrations/Version20200519181249.php @@ -0,0 +1,37 @@ +abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('ALTER TABLE tweet CHANGE user_image user_image VARCHAR(100) DEFAULT NULL'); + $this->addSql('ALTER TABLE hashtag CHANGE name name VARCHAR(100) DEFAULT NULL, CHANGE last_tweet last_tweet VARCHAR(255) DEFAULT NULL'); + } + + public function down(Schema $schema) : void + { + // this down() migration is auto-generated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('ALTER TABLE hashtag CHANGE name name VARCHAR(100) CHARACTER SET utf8mb4 DEFAULT \'NULL\' COLLATE `utf8mb4_unicode_ci`, CHANGE last_tweet last_tweet VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \'NULL\' COLLATE `utf8mb4_unicode_ci`'); + $this->addSql('ALTER TABLE tweet CHANGE user_image user_image VARCHAR(100) CHARACTER SET utf8mb4 DEFAULT \'NULL\' COLLATE `utf8mb4_unicode_ci`'); + } +}