at the end of the day, it was inevitable

This commit is contained in:
Mo Elzubeir
2022-12-09 08:36:26 -06:00
commit 1218570914
1768 changed files with 887087 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="socialhose" default="build">
<property environment="env"/>
<target name="build"
depends="prepare,lint,phpcs-ci"/>
<target name="clean" description="Cleanup build artifacts">
<delete dir="${env.WORKSPACE}/.build/logs"/>
<delete dir="${env.WORKSPACE}/.build/reports"/>
</target>
<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="${env.WORKSPACE}/.build/logs"/>
<mkdir dir="${env.WORKSPACE}/.build/reports"/>
</target>
<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true" verbose="false">
<arg value="-l" />
<fileset dir="${env.WORKSPACE}/">
<include name="**/*.php" />
<exclude name="**/vendor/**"/>
<exclude name="**/cache/**"/>
<modified />
</fileset>
</apply>
</target>
<target name="phpcs-ci" description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
<exec executable="phpcs">
<arg value="--report=checkstyle" />
<arg value="--report-file=${env.WORKSPACE}/.build/logs/checkstyle.xml" />
<arg value="--standard=Symfony2" />
<arg path="${env.WORKSPACE}/src" />
</exec>
</target>
<target name="phpmd-ci" description="Perform project mess detection using PHPMD creating a log file for the continuous integration server">
<exec executable="phpmd">
<arg path="${env.WORKSPACE}/src" />
<arg value="xml" />
<arg value="sibers_pmd" />
<arg value="--reportfile" />
<arg value="${env.WORKSPACE}/.build/logs/pmd.xml" />
<arg value="--exclude=/cache/,/logs/,/vendor/,/test/" />
</exec>
</target>
<target name="phploc" description="Measure project size using PHPLOC">
<exec executable="phploc">
<arg value="--exclude=cache,logs,vendor,test" />
<arg value="--log-csv" />
<arg value="${env.WORKSPACE}/.build/logs/phploc.csv" />
<arg path="${env.WORKSPACE}/src" />
</exec>
</target>
</project>
View File
+76
View File
@@ -0,0 +1,76 @@
# This is a basic workflow to help you get started with Actions
name: Deploy-Pipline-To-AWS-EC2
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the symfony_3.4 branch
on:
push:
branches: [ symfony_3.4 ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
# - name: Test script
# run: cp app/config/parameters.yml.production app/config/parameters.yml
# - name: Frontend install
# run: cp frontend/app/appConfig.js.production frontend/app/appConfig.js
# - run: cd frontend && npm install
# - run: cd frontend && npm run build
- name: ssh scp ssh pipelines
uses: cross-the-world/ssh-scp-ssh-pipelines@latest
env:
WELCOME: "ssh scp ssh pipelines"
LASTSSH: "Doing something after copying"
with:
host: 3.138.54.84
user: deploy
pass: eivuz6Ai
connect_timeout: 10s
first_ssh: |
cd /var/www/html
echo eivuz6Ai | sudo -S rm -r app
echo eivuz6Ai | sudo -S rm -r behat
echo eivuz6Ai | sudo -S rm -r behat.yml
echo eivuz6Ai | sudo -S rm -r bin
echo eivuz6Ai | sudo -S rm -r Capfile
echo eivuz6Ai | sudo -S rm -r composer.json
echo eivuz6Ai | sudo -S rm -r composer.lock
echo eivuz6Ai | sudo -S rm -r configuration
echo eivuz6Ai | sudo -S rm -r deploy-aws.sh
echo eivuz6Ai | sudo -S rm -r docker
echo eivuz6Ai | sudo -S rm -r docker-compose.yml
echo eivuz6Ai | sudo -S rm -r frontend
echo eivuz6Ai | sudo -S rm -r phpunit.xml.dist
echo eivuz6Ai | sudo -S rm -r README.md
echo eivuz6Ai | sudo -S rm -r hose_external_schema.json
echo eivuz6Ai | sudo -S rm -r src
echo eivuz6Ai | sudo -S rm -r supervisor-start.sh
echo eivuz6Ai | sudo -S rm -r tests
echo eivuz6Ai | sudo -S rm -r update.sh
echo eivuz6Ai | sudo -S rm -r web
scp: |
'*' => /var/www/html
last_ssh: |
cp /var/www/html/app/config/parameters.yml.production /var/www/html/app/config/parameters.yml
cd /var/www/html && composer install
cd /var/www/html && php bin/console doctrine:migrations:migrate --no-interaction
cp /var/www/html/frontend/app/appConfig.js.production /var/www/html/frontend/app/appConfig.js
cd /var/www/html/frontend && npm install
cd /var/www/html/frontend && npm run build
echo eivuz6Ai | sudo -S chown -R apache:apache /var/www/html/web
cd /var/www/html && php bin/console cache:clear --env=prod --no-debug
rm -r /var/www/html/var/cache/stage/*
. /var/www/deploy-aws.sh
+76
View File
@@ -0,0 +1,76 @@
# This is a basic workflow to help you get started with Actions
name: Deploy-Staging-To-AWS-EC2
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the symfony_3.4 branch
on:
push:
branches: [ staging ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
# - name: Test script
# run: cp app/config/parameters.yml.production app/config/parameters.yml
# - name: Frontend install
# run: cp frontend/app/appConfig.js.production frontend/app/appConfig.js
# - run: cd frontend && npm install
# - run: cd frontend && npm run build
- name: ssh scp ssh pipelines
uses: cross-the-world/ssh-scp-ssh-pipelines@latest
env:
WELCOME: "ssh scp ssh pipelines"
LASTSSH: "Doing something after copying"
with:
host: 3.133.134.95
user: deploy
pass: eivuz6Ai
connect_timeout: 10s
first_ssh: |
cd /var/www/html
echo eivuz6Ai | sudo -S rm -r app
echo eivuz6Ai | sudo -S rm -r behat
echo eivuz6Ai | sudo -S rm -r behat.yml
echo eivuz6Ai | sudo -S rm -r bin
echo eivuz6Ai | sudo -S rm -r Capfile
echo eivuz6Ai | sudo -S rm -r composer.json
echo eivuz6Ai | sudo -S rm -r composer.lock
echo eivuz6Ai | sudo -S rm -r configuration
echo eivuz6Ai | sudo -S rm -r deploy-aws.sh
echo eivuz6Ai | sudo -S rm -r docker
echo eivuz6Ai | sudo -S rm -r docker-compose.yml
echo eivuz6Ai | sudo -S rm -r frontend
echo eivuz6Ai | sudo -S rm -r phpunit.xml.dist
echo eivuz6Ai | sudo -S rm -r README.md
echo eivuz6Ai | sudo -S rm -r hose_external_schema.json
echo eivuz6Ai | sudo -S rm -r src
echo eivuz6Ai | sudo -S rm -r supervisor-start.sh
echo eivuz6Ai | sudo -S rm -r tests
echo eivuz6Ai | sudo -S rm -r update.sh
echo eivuz6Ai | sudo -S rm -r web
scp: |
'*' => /var/www/html
last_ssh: |
cp /var/www/html/app/config/parameters.yml.staging /var/www/html/app/config/parameters.yml
cd /var/www/html && composer install
cd /var/www/html && php bin/console doctrine:migrations:migrate --no-interaction
cp /var/www/html/frontend/app/appConfig.js.staging /var/www/html/frontend/app/appConfig.js
cd /var/www/html/frontend && npm install
cd /var/www/html/frontend && npm run build
echo eivuz6Ai | sudo -S chown -R apache:apache /var/www/html/web
cd /var/www/html && php bin/console cache:clear --env=prod --no-debug
rm -r /var/www/html/var/cache/stage/*
. /var/www/deploy-aws.sh
+42
View File
@@ -0,0 +1,42 @@
/app/config/parameters.yml
/app/config/parameters.yml.*
/frontend/app/appConfig.js.production
/app/config/cert/*
/build/
/phpunit.xml
/var/*
!/var/cache
/var/cache/*
!var/cache/.gitkeep
!/var/logs
/var/logs/*
!var/logs/.gitkeep
!/var/sessions
/var/sessions/*
!var/sessions/.gitkeep
!var/SymfonyRequirements.php
/vendor/
/web/bundles/
/composer.phar
.idea
/.build/tests/screenshots/*
!.build/tests/screenshots/.gitkeep
/web/assets/*
!/web/assets/.gitkeep
/web/dist/*
/frontend/node_modules
/frontend/app/appConfig.js
!/web/dist/.gitkeep
npm-debug.log
/.project
src/QueueBundle/Resources/config/parameters.ini
*~
!/src/CacheBundle/Feed/Formatter/Strategy/FeedFormatterStrategyInterface.php
docker/mysql/data/*
!docker/mysql/data/.gitkeep
.env
+4
View File
@@ -0,0 +1,4 @@
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
require 'capifony_symfony2'
load 'app/config/deploy'
+115
View File
@@ -0,0 +1,115 @@
# Setup
### Requirement
- php
Version: greater or equal to 7.2
Extensions:
- bcmath
- libxml
- mbstring
- openssl
- xml
- curl
- ElasticSearch 5.x
- RabbitMQ
- Apache2
### Install
1. Run
composer install
./bin/console doctrine:database:create
./bin/console doctrine:migrations:migrate --no-interaction
./bin/console socialhose:fixture:load --force
setfacl -dR -m u:"www-data":rwX -m u:$(whoami):rwX var
setfacl -R -m u:"www-data":rwX -m u:$(whoami):rwX var
2. Use configuration from `configuration` directory
3. Regenerate public and private keys in **app/config/cert** and update options in **app/config/parameters.yml**
- jwt_private_key_path
- jwt_public_key_path
- jwt_key_pass_phrase
# Tests
composer test
or separately
composer unit-test
composer behat-test
Also you can run test by hand, like this:
- Run unit test
phpunit
- Run all functional test
behat -s api
behat -s command
or for group
behat -s api behat/features/Security
or for concrete feature
behat -s api behat/features/Security/token/create.feature
or run in debug mode (behat will print out all request options and responses)
DEBUG=true behat -s api
or for fast test, without recreating database and cache clear
WITHOUT_CLEAR=true behat -s api
### Docker
- Add UID to environment file: `echo "UID=$UID" >> .env`
- docker-compose up --build -d
- make sure all containers build and run successfully (`docker-compose ps`):
- socialhose-elastic
- socialhose-elastic-hq
- socialhose-mysql
- socialhose-php
- socialhose-rabbit
- `docker-compose exec socialhose-php bash`
Go into container. All next commands should be running in it.
- install \ update backend
- `sudo setfacl -dR -m u:"www-data":rwX -m u:$(whoami):rwX var`
- `sudo setfacl -R -m u:"www-data":rwX -m u:$(whoami):rwX var`
- `cp app/config/parameters.yml.docker app/config/parameters.yml`
- `composer1 install`
- database migration
- `./bin/console doctrine:migrations:migrate --no-interaction`
Migration is broken and can temporarily be bypassed by commenting out the up commands in VersionVersion20210212114326
- `./bin/console socialhose:fixture:load --force`
- install \ update frontend
- `cp frontend/app/appConfig.js.docker frontend/app/appConfig.js`
- `cd frontend`
- `npm install`
- `npm run build`
## Add twitter, instagram fixtures
- `docker-compose exec socialhose-php bash`
- `cd socialhosefixtures`
- `./add-fixtures.sh`
## Services are available under following urls:
- http://localhost:8081/app_dev.php - main site
- http://localhost:5000 - elastic hq (use http://socialhose-elastic:9200 for connect to elastic service)
- http://localhost:15672 - rabbitMQ UI
- MySQL external port is 33066
- http://localhost:8025/ - mail UI
+7
View File
@@ -0,0 +1,7 @@
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
+7
View File
@@ -0,0 +1,7 @@
<?php
use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
class AppCache extends HttpCache
{
}
+80
View File
@@ -0,0 +1,80 @@
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
/**
* Class AppKernel
*/
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new FOS\UserBundle\FOSUserBundle(),
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
new Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle(),
new Gesdinet\JWTRefreshTokenBundle\GesdinetJWTRefreshTokenBundle(),
new Nelmio\CorsBundle\NelmioCorsBundle(),
new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
new Miracode\StripeBundle\MiracodeStripeBundle(),
new AdminBundle\AdminBundle(),
new IndexBundle\IndexBundle(),
new CacheBundle\CacheBundle(),
new UserBundle\UserBundle(),
new ApiBundle\ApiBundle(),
new AuthenticationBundle\AuthenticationBundle(),
new AppBundle\AppBundle(),
new QueueBundle\QueueBundle(),
new PaymentBundle\PaymentBundle(),
];
if (in_array($this->getEnvironment(), [ 'dev', 'stage', 'test' ], true)) {
$bundles[] = new Nelmio\ApiDocBundle\NelmioApiDocBundle();
$bundles[] = new ApiDocBundle\ApiDocBundle();
$bundles[] =
new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
}
if (in_array($this->getEnvironment(), [ 'dev', 'test' ], true)) {
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] =
new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
}
return $bundles;
}
public function getRootDir()
{
return __DIR__;
}
public function getCacheDir()
{
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
}
public function getLogDir()
{
return dirname(__DIR__).'/var/logs';
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
}
}
@@ -0,0 +1,163 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20161221180933 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('
CREATE TABLE pages (
id INT AUTO_INCREMENT NOT NULL,
query_id INT DEFAULT NULL,
document_id VARCHAR(255) DEFAULT NULL,
number INT NOT NULL,
INDEX IDX_2074E575EF946F99 (query_id),
INDEX IDX_2074E575C33F7837 (document_id),
PRIMARY KEY(id)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci ENGINE = InnoDB
');
$this->addSql('
CREATE TABLE queries (
id INT AUTO_INCREMENT NOT NULL,
string LONGTEXT NOT NULL,
types LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\',
unique_name VARCHAR(255) NOT NULL,
date DATETIME NOT NULL,
expiration_date DATETIME NOT NULL,
total_count INT NOT NULL,
PRIMARY KEY(id)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('
CREATE TABLE documents (
sequence VARCHAR(255) NOT NULL,
bucket BIGINT DEFAULT NULL,
sequence_range BIGINT DEFAULT NULL,
hashcode LONGTEXT DEFAULT NULL,
resource LONGTEXT DEFAULT NULL,
section VARCHAR(255) DEFAULT NULL,
date_found DATETIME DEFAULT NULL,
index_method VARCHAR(255) DEFAULT NULL,
detection_method VARCHAR(255) DEFAULT NULL,
version VARCHAR(255) DEFAULT NULL,
source_hashcode VARCHAR(255) DEFAULT NULL,
source_resource VARCHAR(255) DEFAULT NULL,
source_link VARCHAR(255) DEFAULT NULL,
source_publisher_type VARCHAR(255) DEFAULT NULL,
source_date_found DATETIME DEFAULT NULL,
source_last_updated DATETIME DEFAULT NULL,
source_last_published DATETIME DEFAULT NULL,
source_last_posted DATETIME DEFAULT NULL,
source_update_interval BIGINT DEFAULT NULL,
source_http_status INT DEFAULT NULL,
source_content_length INT DEFAULT NULL,
source_content_checksum VARCHAR(255) DEFAULT NULL,
source_assigned_tags VARCHAR(255) DEFAULT NULL,
strategy_source_setting_update VARCHAR(255) DEFAULT NULL,
strategy_source_setting_index VARCHAR(255) DEFAULT NULL,
source_title VARCHAR(255) DEFAULT NULL,
source_description VARCHAR(255) DEFAULT NULL,
source_feed_href VARCHAR(255) DEFAULT NULL,
source_feed_title VARCHAR(255) DEFAULT NULL,
source_feed_format VARCHAR(255) DEFAULT NULL,
permalink VARCHAR(255) DEFAULT NULL,
permalink_redirect VARCHAR(255) DEFAULT NULL,
permalink_redirect_domain VARCHAR(255) DEFAULT NULL,
permalink_redirect_site VARCHAR(255) DEFAULT NULL,
canonical VARCHAR(255) DEFAULT NULL,
domain VARCHAR(255) DEFAULT NULL,
site VARCHAR(255) DEFAULT NULL,
main LONGTEXT DEFAULT NULL,
main_length INT DEFAULT NULL,
main_checksum VARCHAR(255) DEFAULT NULL,
main_format VARCHAR(255) DEFAULT NULL,
extract LONGTEXT DEFAULT NULL,
extract_length INT DEFAULT NULL,
extract_checksum VARCHAR(255) DEFAULT NULL,
summary_text LONGTEXT DEFAULT NULL,
title VARCHAR(255) DEFAULT NULL,
published DATETIME DEFAULT NULL,
publisher VARCHAR(255) DEFAULT NULL,
description VARCHAR(255) DEFAULT NULL,
html LONGTEXT DEFAULT NULL,
html_length INT DEFAULT NULL,
links VARCHAR(255) DEFAULT NULL,
author_name VARCHAR(255) DEFAULT NULL,
author_link VARCHAR(255) DEFAULT NULL,
author_gender VARCHAR(255) DEFAULT NULL,
image_src VARCHAR(255) DEFAULT NULL,
card VARCHAR(255) DEFAULT NULL,
type VARCHAR(255) DEFAULT NULL,
sentiment VARCHAR(255) DEFAULT NULL,
lang VARCHAR(255) DEFAULT NULL,
metadata_score INT DEFAULT NULL,
PRIMARY KEY(sequence)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('
CREATE TABLE users (
id INT AUTO_INCREMENT NOT NULL,
username VARCHAR(180) NOT NULL,
username_canonical VARCHAR(180) NOT NULL,
email VARCHAR(180) NOT NULL,
email_canonical VARCHAR(180) NOT NULL,
enabled TINYINT(1) NOT NULL,
salt VARCHAR(255) DEFAULT NULL,
password VARCHAR(255) NOT NULL,
last_login DATETIME DEFAULT NULL,
confirmation_token VARCHAR(180) DEFAULT NULL,
password_requested_at DATETIME DEFAULT NULL,
roles LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\',
UNIQUE INDEX UNIQ_1483A5E992FC23A8 (username_canonical),
UNIQUE INDEX UNIQ_1483A5E9A0D96FBF (email_canonical),
UNIQUE INDEX UNIQ_1483A5E9C05FB297 (confirmation_token),
PRIMARY KEY(id)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci ENGINE = InnoDB
');
$this->addSql('
ALTER TABLE pages
ADD CONSTRAINT FK_2074E575EF946F99
FOREIGN KEY (query_id) REFERENCES queries (id)
');
$this->addSql('
ALTER TABLE pages
ADD CONSTRAINT FK_2074E575C33F7837
FOREIGN KEY (document_id) REFERENCES documents (sequence)
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 pages DROP FOREIGN KEY FK_2074E575EF946F99');
$this->addSql('ALTER TABLE pages DROP FOREIGN KEY FK_2074E575C33F7837');
$this->addSql('DROP TABLE pages');
$this->addSql('DROP TABLE queries');
$this->addSql('DROP TABLE documents');
$this->addSql('DROP TABLE users');
}
}
@@ -0,0 +1,42 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20161222151030 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 documents
CHANGE source_assigned_tags source_assigned_tags LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\',
CHANGE links links LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\'
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 documents
CHANGE source_assigned_tags source_assigned_tags VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci,
CHANGE links links VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci
');
}
}
@@ -0,0 +1,61 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20161223144722 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 queries
ADD user_id INT DEFAULT NULL,
ADD type VARCHAR(255) NOT NULL,
ADD limit_exceed TINYINT(1) DEFAULT NULL,
ADD last_update_at DATETIME DEFAULT NULL,
CHANGE expiration_date expiration_date DATETIME DEFAULT NULL
');
$this->addSql('
ALTER TABLE queries
ADD CONSTRAINT FK_8AF84772A76ED395
FOREIGN KEY (user_id) REFERENCES users (id)
');
$this->addSql('CREATE INDEX IDX_8AF84772A76ED395 ON queries (user_id)');
$this->addSql("
UPDATE queries
SET type = 'simple'
");
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 queries DROP FOREIGN KEY FK_8AF84772A76ED395');
$this->addSql('DROP INDEX IDX_8AF84772A76ED395 ON queries');
$this->addSql('
ALTER TABLE queries
DROP user_id,
DROP type,
DROP limit_exceed,
DROP last_update_at,
CHANGE expiration_date expiration_date DATETIME NOT NULL
');
}
}
@@ -0,0 +1,38 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170105131820 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 pages ADD score DOUBLE PRECISION NOT NULL');
$this->addSql('
UPDATE pages
SET score = 1.0
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 pages DROP score');
}
}
@@ -0,0 +1,42 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170106150012 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 queries
CHANGE unique_name normalized LONGTEXT NOT NULL COLLATE utf8_unicode_ci,
CHANGE string raw LONGTEXT NOT NULL COLLATE utf8_unicode_ci
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 queries
CHANGE raw string LONGTEXT NOT NULL COLLATE utf8_unicode_ci,
CHANGE normalized unique_name VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci
');
}
}
@@ -0,0 +1,36 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170110184359 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 queries ADD hash VARCHAR(255) NOT NULL');
$this->addSql('CREATE INDEX hash_idx ON queries (hash)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('DROP INDEX hash_idx ON queries');
$this->addSql('ALTER TABLE queries DROP hash');
}
}
@@ -0,0 +1,39 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170113190543 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 documents
ADD country VARCHAR(255) DEFAULT NULL,
ADD state VARCHAR(255) DEFAULT NULL,
ADD city VARCHAR(255) DEFAULT NULL
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 documents DROP country, DROP state, DROP city');
}
}
@@ -0,0 +1,52 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170116173457 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('
CREATE TABLE jobs (
id INT AUTO_INCREMENT NOT NULL,
query_id INT DEFAULT NULL,
INDEX IDX_A8936DC5EF946F99 (query_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB
');
$this->addSql('
ALTER TABLE jobs
ADD CONSTRAINT FK_A8936DC5EF946F99 FOREIGN KEY (query_id)
REFERENCES queries (id)
');
$this->addSql('ALTER TABLE queries ADD status VARCHAR(255) DEFAULT NULL');
$this->addSql("
UPDATE queries
SET status = 'synced'
");
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('DROP TABLE jobs');
$this->addSql('ALTER TABLE queries DROP status');
}
}
@@ -0,0 +1,40 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170127122322 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 queries
CHANGE types filters LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\'
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 queries
CHANGE filters types LONGTEXT NOT NULL COLLATE utf8_unicode_ci COMMENT \'(DC2Type:array)\'
');
}
}
@@ -0,0 +1,52 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170130165430 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('
CREATE TABLE sessions (
sess_id INT AUTO_INCREMENT NOT NULL,
sess_data LONGTEXT NOT NULL COLLATE utf8_unicode_ci,
sess_time DATETIME NOT NULL,
PRIMARY KEY(sess_id)
) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB
');
$this->addSql('
CREATE TABLE refresh_tokens (
id INT AUTO_INCREMENT NOT NULL,
refresh_token VARCHAR(128) NOT NULL,
username VARCHAR(255) NOT NULL,
valid DATETIME NOT NULL,
UNIQUE INDEX UNIQ_9BACE7E1C74F2195 (refresh_token),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('DROP TABLE sessions');
$this->addSql('DROP TABLE refresh_tokens');
}
}
@@ -0,0 +1,39 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170131112539 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 documents
ADD shares INT DEFAULT NULL,
ADD views INT DEFAULT NULL,
ADD source_location VARCHAR(255) DEFAULT NULL
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 documents DROP shares, DROP views, DROP source_location');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170131112706 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 documents ADD shared_identifier VARCHAR(255) DEFAULT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 documents DROP shared_identifier');
}
}
@@ -0,0 +1,64 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170131163118 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('
CREATE TABLE categories (
id INT AUTO_INCREMENT NOT NULL,
user_id INT DEFAULT NULL,
INDEX IDX_3AF34668A76ED395 (user_id),
name VARCHAR(255) NOT NULL,
internal TINYINT(1) NOT NULL,
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB
');
$this->addSql('
ALTER TABLE categories
ADD CONSTRAINT FK_3AF34668A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)
');
$this->addSql('
ALTER TABLE queries
ADD category_id INT DEFAULT NULL,
ADD name VARCHAR(255) DEFAULT NULL
');
$this->addSql('
ALTER TABLE queries
ADD CONSTRAINT FK_8AF8477212469DE2 FOREIGN KEY (category_id) REFERENCES categories (id)
');
$this->addSql('CREATE INDEX IDX_8AF8477212469DE2 ON queries (category_id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 queries DROP FOREIGN KEY FK_8AF8477212469DE2');
$this->addSql('DROP TABLE categories');
$this->addSql('DROP INDEX IDX_8AF8477212469DE2 ON queries');
$this->addSql('
ALTER TABLE queries
DROP category_id,
DROP name
');
}
}
@@ -0,0 +1,41 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170205175114 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('DROP TABLE IF EXISTS sessions');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('
CREATE TABLE sessions (
sess_id INT AUTO_INCREMENT NOT NULL,
sess_data LONGTEXT NOT NULL COLLATE utf8_unicode_ci,
sess_time DATETIME NOT NULL,
PRIMARY KEY(sess_id)
) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB
');
}
}
@@ -0,0 +1,46 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170206154846 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('
CREATE TABLE sources (
id INT AUTO_INCREMENT NOT NULL,
title VARCHAR(255) NOT NULL,
media_type VARCHAR(255) NOT NULL,
license VARCHAR(255) NOT NULL,
country VARCHAR(255) NOT NULL,
rank INT NOT NULL,
url VARCHAR(255) NOT NULL,
PRIMARY KEY(id)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci ENGINE = InnoDB');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('DROP TABLE sources');
}
}
@@ -0,0 +1,63 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170207160549 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 sources
ADD user_id INT DEFAULT NULL,
ADD source_publisher_type VARCHAR(255) NOT NULL,
ADD state VARCHAR(255) NOT NULL,
ADD city VARCHAR(255) NOT NULL,
ADD lang VARCHAR(255) NOT NULL,
ADD section VARCHAR(255) NOT NULL,
ADD deleted TINYINT(1) NOT NULL,
CHANGE media_type type VARCHAR(255) NOT NULL
');
$this->addSql('
ALTER TABLE sources
ADD CONSTRAINT FK_D25D65F2A76ED395 FOREIGN KEY (user_id)
REFERENCES users (id) ON DELETE CASCADE
');
$this->addSql('CREATE INDEX IDX_D25D65F2A76ED395 ON sources (user_id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 sources DROP FOREIGN KEY FK_D25D65F2A76ED395');
$this->addSql('DROP INDEX IDX_D25D65F2A76ED395 ON sources');
$this->addSql('
ALTER TABLE sources
ADD media_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci,
DROP user_id,
DROP type,
DROP source_publisher_type,
DROP state,
DROP city,
DROP lang,
DROP section,
DROP deleted
');
}
}
@@ -0,0 +1,42 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170207162507 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 sources DROP FOREIGN KEY FK_D25D65F2A76ED395');
$this->addSql('DROP INDEX IDX_D25D65F2A76ED395 ON sources');
$this->addSql('ALTER TABLE sources DROP user_id');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 sources ADD user_id INT DEFAULT NULL');
$this->addSql('
ALTER TABLE sources
ADD CONSTRAINT FK_D25D65F2A76ED395 FOREIGN KEY (user_id)
REFERENCES users (id) ON DELETE CASCADE
');
$this->addSql('CREATE INDEX IDX_D25D65F2A76ED395 ON sources (user_id)');
}
}
@@ -0,0 +1,70 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170207170330 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('
CREATE TABLE source_list (
id INT AUTO_INCREMENT NOT NULL,
user_id INT DEFAULT NULL,
title VARCHAR(255) NOT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
deleted TINYINT(1) NOT NULL,
INDEX IDX_45427D1BA76ED395 (user_id),
PRIMARY KEY(id)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('
CREATE TABLE sources_to_sources_lists (
source_id INT NOT NULL,
source_list_id INT NOT NULL,
INDEX IDX_6411C8FE953C1C61 (source_id),
INDEX IDX_6411C8FE7471AEE3 (source_list_id),
PRIMARY KEY(source_id, source_list_id)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('
ALTER TABLE source_list
ADD CONSTRAINT FK_45427D1BA76ED395
FOREIGN KEY (user_id) REFERENCES users (id)');
$this->addSql('
ALTER TABLE sources_to_sources_lists
ADD CONSTRAINT FK_6411C8FE953C1C61
FOREIGN KEY (source_id) REFERENCES sources (id) ON DELETE CASCADE');
$this->addSql('
ALTER TABLE sources_to_sources_lists
ADD CONSTRAINT FK_6411C8FE7471AEE3
FOREIGN KEY (source_list_id) REFERENCES source_list (id) ON DELETE CASCADE');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 sources_to_sources_lists DROP FOREIGN KEY FK_6411C8FE7471AEE3');
$this->addSql('DROP TABLE source_list');
$this->addSql('DROP TABLE sources_to_sources_lists');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170208110737 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 source_list ADD is_global TINYINT(1) NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 source_list DROP is_global');
}
}
@@ -0,0 +1,38 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170209075009 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 users
ADD first_name VARCHAR(255) NOT NULL,
ADD last_name VARCHAR(255) NOT NULL
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 users DROP first_name, DROP last_name');
}
}
@@ -0,0 +1,93 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170210123519 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('
CREATE TABLE cross_users_stored_queries (
id INT AUTO_INCREMENT NOT NULL,
query_id INT DEFAULT NULL,
user_id INT DEFAULT NULL,
category_id INT DEFAULT NULL,
name VARCHAR(255) NOT NULL,
INDEX IDX_A2E1F665EF946F99 (query_id),
INDEX IDX_A2E1F665A76ED395 (user_id),
INDEX IDX_A2E1F66512469DE2 (category_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB
');
$this->addSql('
ALTER TABLE cross_users_stored_queries
ADD CONSTRAINT FK_A2E1F665EF946F99
FOREIGN KEY (query_id)
REFERENCES queries (id)
');
$this->addSql('
ALTER TABLE cross_users_stored_queries
ADD CONSTRAINT FK_A2E1F665A76ED395
FOREIGN KEY (user_id)
REFERENCES users (id)
');
$this->addSql('
ALTER TABLE cross_users_stored_queries
ADD CONSTRAINT FK_A2E1F66512469DE2
FOREIGN KEY (category_id)
REFERENCES categories (id)
');
$this->addSql('ALTER TABLE queries DROP FOREIGN KEY FK_8AF84772A76ED395');
$this->addSql('ALTER TABLE queries DROP FOREIGN KEY FK_8AF8477212469DE2');
$this->addSql('DROP INDEX IDX_8AF84772A76ED395 ON queries');
$this->addSql('DROP INDEX IDX_8AF8477212469DE2 ON queries');
$this->addSql('ALTER TABLE queries DROP user_id, DROP category_id, DROP name');
$this->addSql('ALTER TABLE source_list CHANGE title name VARCHAR(255) NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('DROP TABLE cross_users_stored_queries');
$this->addSql('
ALTER TABLE queries ADD user_id INT DEFAULT NULL,
ADD category_id INT DEFAULT NULL,
ADD name VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci
');
$this->addSql('
ALTER TABLE queries
ADD CONSTRAINT FK_8AF84772A76ED395
FOREIGN KEY (user_id)
REFERENCES users (id)
');
$this->addSql('
ALTER TABLE queries
ADD CONSTRAINT FK_8AF8477212469DE2
FOREIGN KEY (category_id)
REFERENCES categories (id)
');
$this->addSql('CREATE INDEX IDX_8AF84772A76ED395 ON queries (user_id)');
$this->addSql('CREATE INDEX IDX_8AF8477212469DE2 ON queries (category_id)');
$this->addSql('
ALTER TABLE source_list
CHANGE name title VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci
');
}
}
@@ -0,0 +1,37 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170213113612 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 queries
ADD fields LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\'
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 queries DROP fields');
}
}
@@ -0,0 +1,50 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170214044904 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 users
ADD organization VARCHAR(255) NOT NULL,
ADD expiration_day DATETIME DEFAULT NULL,
ADD number_of_subscriber INT NOT NULL,
ADD number_of_saved_fields_allowed INT NOT NULL,
ADD number_of_newsletters_allowed INT NOT NULL,
ADD number_of_searches_allowed INT NOT NULL
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 users
DROP organization,
DROP expiration_day,
DROP number_of_subscriber,
DROP number_of_saved_fields_allowed,
DROP number_of_newsletters_allowed,
DROP number_of_searches_allowed
');
}
}
@@ -0,0 +1,40 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170214050359 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 users
CHANGE number_of_searches_allowed number_of_searches_per_day_allowed INT NOT NULL
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 users
CHANGE number_of_searches_per_day_allowed number_of_searches_allowed INT NOT NULL
');
}
}
@@ -0,0 +1,39 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170215051338 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE sources_to_sections (source_id INT NOT NULL, section_id INT NOT NULL, INDEX IDX_475C417E953C1C61 (source_id), INDEX IDX_475C417ED823E37A (section_id), PRIMARY KEY(source_id, section_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE sections (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE sources_to_sections ADD CONSTRAINT FK_475C417E953C1C61 FOREIGN KEY (source_id) REFERENCES sources (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE sources_to_sections ADD CONSTRAINT FK_475C417ED823E37A FOREIGN KEY (section_id) REFERENCES sections (id) ON DELETE CASCADE');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 sources_to_sections DROP FOREIGN KEY FK_475C417ED823E37A');
$this->addSql('DROP TABLE sources_to_sections');
$this->addSql('DROP TABLE sections');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170215051526 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 sources DROP section');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 sources ADD section VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
}
}
@@ -0,0 +1,42 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170217121217 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 categories ADD parent_id INT DEFAULT NULL');
$this->addSql('
ALTER TABLE categories
ADD CONSTRAINT FK_3AF34668727ACA70
FOREIGN KEY (parent_id) REFERENCES categories (id)
');
$this->addSql('CREATE INDEX IDX_3AF34668727ACA70 ON categories (parent_id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 categories DROP FOREIGN KEY FK_3AF34668727ACA70');
$this->addSql('DROP INDEX IDX_3AF34668727ACA70 ON categories');
$this->addSql('ALTER TABLE categories DROP parent_id');
}
}
@@ -0,0 +1,94 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170219142028 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('
CREATE TABLE feeds (
id INT AUTO_INCREMENT NOT NULL,
user_id INT DEFAULT NULL,
category_id INT DEFAULT NULL,
query_id INT DEFAULT NULL,
name VARCHAR(255) NOT NULL,
type VARCHAR(255) NOT NULL,
INDEX IDX_5A29F52FA76ED395 (user_id),
INDEX IDX_5A29F52F12469DE2 (category_id),
INDEX IDX_5A29F52FEF946F99 (query_id), PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('
ALTER TABLE feeds
ADD CONSTRAINT FK_5A29F52FA76ED395
FOREIGN KEY (user_id)
REFERENCES users (id)
');
$this->addSql('
ALTER TABLE feeds
ADD CONSTRAINT FK_5A29F52F12469DE2
FOREIGN KEY (category_id)
REFERENCES categories (id)
');
$this->addSql('
ALTER TABLE feeds
ADD CONSTRAINT FK_5A29F52FEF946F99
FOREIGN KEY (query_id)
REFERENCES queries (id)
');
$this->addSql('DROP TABLE cross_users_stored_queries');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('
CREATE TABLE cross_users_stored_queries (
id INT AUTO_INCREMENT NOT NULL,
category_id INT DEFAULT NULL,
user_id INT DEFAULT NULL,
query_id INT DEFAULT NULL,
name VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci,
INDEX IDX_A2E1F665EF946F99 (query_id),
INDEX IDX_A2E1F665A76ED395 (user_id),
INDEX IDX_A2E1F66512469DE2 (category_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('
ALTER TABLE cross_users_stored_queries
ADD CONSTRAINT FK_A2E1F66512469DE2
FOREIGN KEY (category_id)
REFERENCES categories (id)
');
$this->addSql('
ALTER TABLE cross_users_stored_queries
ADD CONSTRAINT FK_A2E1F665A76ED395
FOREIGN KEY (user_id)
REFERENCES users (id)
');
$this->addSql('
ALTER TABLE cross_users_stored_queries
ADD CONSTRAINT FK_A2E1F665EF946F99
FOREIGN KEY (query_id)
REFERENCES queries (id)
');
$this->addSql('DROP TABLE feeds');
}
}
@@ -0,0 +1,37 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170220073111 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 feeds
ADD publisher_types LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\'
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 feeds DROP publisher_types');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170220142446 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 categories ADD type VARCHAR(255) NOT NULL, DROP internal');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 categories ADD internal TINYINT(1) NOT NULL, DROP type');
}
}
@@ -0,0 +1,42 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170222065333 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 users ADD master_user INT DEFAULT NULL');
$this->addSql('
ALTER TABLE users
ADD CONSTRAINT FK_1483A5E9A626FB20
FOREIGN KEY (master_user) REFERENCES users (id)'
);
$this->addSql('CREATE INDEX IDX_1483A5E9A626FB20 ON users (master_user)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 users DROP FOREIGN KEY FK_1483A5E9A626FB20');
$this->addSql('DROP INDEX IDX_1483A5E9A626FB20 ON users');
$this->addSql('ALTER TABLE users DROP master_user');
}
}
@@ -0,0 +1,58 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170223051007 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 source_list DROP FOREIGN KEY FK_45427D1BA76ED395');
$this->addSql('
ALTER TABLE source_list
ADD CONSTRAINT FK_45427D1BA76ED395
FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE
');
$this->addSql('CREATE INDEX source_search_idx ON sources (title, type)');
$this->addSql('ALTER TABLE users DROP FOREIGN KEY FK_1483A5E9A626FB20');
$this->addSql('
ALTER TABLE users
ADD CONSTRAINT FK_1483A5E9A626FB20
FOREIGN KEY (master_user) REFERENCES users (id) ON DELETE CASCADE
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 source_list DROP FOREIGN KEY FK_45427D1BA76ED395');
$this->addSql('
ALTER TABLE source_list
ADD CONSTRAINT FK_45427D1BA76ED395
FOREIGN KEY (user_id) REFERENCES users (id)
');
$this->addSql('DROP INDEX source_search_idx ON sources');
$this->addSql('ALTER TABLE users DROP FOREIGN KEY FK_1483A5E9A626FB20');
$this->addSql('
ALTER TABLE users
ADD CONSTRAINT FK_1483A5E9A626FB20
FOREIGN KEY (master_user) REFERENCES users (id)
');
}
}
@@ -0,0 +1,45 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170223075915 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('
CREATE TABLE site_settings
(
id INT AUTO_INCREMENT NOT NULL,
title VARCHAR(255) NOT NULL,
name VARCHAR(255) NOT NULL,
value VARCHAR(255) NOT NULL,
PRIMARY KEY(id)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci ENGINE = InnoDB
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('DROP TABLE site_settings');
}
}
@@ -0,0 +1,39 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170228093313 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 users
ADD position VARCHAR(255) NOT NULL,
ADD phone_number VARCHAR(255) NOT NULL,
ADD allow_to_create_saved_feeds TINYINT(1) NOT NULL
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 users DROP position, DROP phone_number, DROP allow_to_create_saved_feeds');
}
}
@@ -0,0 +1,103 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170302050031 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('
CREATE TABLE saved_analyse (
id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(255) NOT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
PRIMARY KEY(id)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci ENGINE = InnoDB
');
$this->addSql('
CREATE TABLE analytic_reports_to_charts (
analytic_report_id INT NOT NULL,
chart_id INT NOT NULL,
INDEX IDX_EEB700806ADC7F69 (analytic_report_id),
INDEX IDX_EEB70080BEF83E0A (chart_id),
PRIMARY KEY(analytic_report_id, chart_id)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci ENGINE = InnoDB
');
$this->addSql('
CREATE TABLE analytics_reports_to_queries (
analytic_report_id INT NOT NULL,
stored_query_id INT NOT NULL,
INDEX IDX_1D5B43456ADC7F69 (analytic_report_id),
INDEX IDX_1D5B4345C113F4B (stored_query_id),
PRIMARY KEY(analytic_report_id, stored_query_id)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci ENGINE = InnoDB
');
$this->addSql('
CREATE TABLE chart (
id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(255) NOT NULL,
identifier VARCHAR(255) NOT NULL,
deleted TINYINT(1) NOT NULL,
PRIMARY KEY(id)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci ENGINE = InnoDB
');
$this->addSql('
ALTER TABLE analytic_reports_to_charts
ADD CONSTRAINT FK_EEB700806ADC7F69
FOREIGN KEY (analytic_report_id) REFERENCES saved_analyse (id)
');
$this->addSql('
ALTER TABLE analytic_reports_to_charts
ADD CONSTRAINT FK_EEB70080BEF83E0A
FOREIGN KEY (chart_id) REFERENCES chart (id)
');
$this->addSql('
ALTER TABLE analytics_reports_to_queries
ADD CONSTRAINT FK_1D5B43456ADC7F69
FOREIGN KEY (analytic_report_id) REFERENCES saved_analyse (id)
');
$this->addSql('
ALTER TABLE analytics_reports_to_queries
ADD CONSTRAINT FK_1D5B4345C113F4B
FOREIGN KEY (stored_query_id) REFERENCES queries (id)
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 analytic_reports_to_charts DROP FOREIGN KEY FK_EEB700806ADC7F69');
$this->addSql('ALTER TABLE analytics_reports_to_queries DROP FOREIGN KEY FK_1D5B43456ADC7F69');
$this->addSql('ALTER TABLE analytic_reports_to_charts DROP FOREIGN KEY FK_EEB70080BEF83E0A');
$this->addSql('DROP TABLE saved_analyse');
$this->addSql('DROP TABLE analytic_reports_to_charts');
$this->addSql('DROP TABLE analytics_reports_to_queries');
$this->addSql('DROP TABLE chart');
}
}
@@ -0,0 +1,57 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170302072240 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE template (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, deleted TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('
CREATE TABLE charts_templates (
chart_id INT NOT NULL,
template_id INT NOT NULL,
INDEX IDX_3B4D6648BEF83E0A (chart_id),
INDEX IDX_3B4D66485DA0FB8 (template_id),
PRIMARY KEY(chart_id, template_id)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci ENGINE = InnoDB
');
$this->addSql('CREATE TABLE chart_category (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, deleted TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE charts_templates ADD CONSTRAINT FK_3B4D6648BEF83E0A FOREIGN KEY (chart_id) REFERENCES chart (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE charts_templates ADD CONSTRAINT FK_3B4D66485DA0FB8 FOREIGN KEY (template_id) REFERENCES template (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE chart ADD chart_category_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE chart ADD CONSTRAINT FK_E5562A2A1E65F97D FOREIGN KEY (chart_category_id) REFERENCES chart_category (id)');
$this->addSql('CREATE INDEX IDX_E5562A2A1E65F97D ON chart (chart_category_id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 charts_templates DROP FOREIGN KEY FK_3B4D66485DA0FB8');
$this->addSql('ALTER TABLE chart DROP FOREIGN KEY FK_E5562A2A1E65F97D');
$this->addSql('DROP TABLE template');
$this->addSql('DROP TABLE charts_templates');
$this->addSql('DROP TABLE chart_category');
$this->addSql('DROP INDEX IDX_E5562A2A1E65F97D ON chart');
$this->addSql('ALTER TABLE chart DROP chart_category_id');
}
}
@@ -0,0 +1,61 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170302090715 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 charts_templates DROP FOREIGN KEY FK_3B4D66485DA0FB8');
$this->addSql('CREATE TABLE chart_template (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, deleted TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('
CREATE TABLE charts_to_chart_templates (
chart_id INT NOT NULL,
chart_template_id INT NOT NULL,
INDEX IDX_8A840E3BBEF83E0A (chart_id),
INDEX IDX_8A840E3B5DA0FB8 (chart_template_id),
PRIMARY KEY(chart_id, chart_template_id)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_unicode_ci ENGINE = InnoDB
');
$this->addSql('ALTER TABLE charts_to_chart_templates ADD CONSTRAINT FK_8A840E3BBEF83E0A FOREIGN KEY (chart_id) REFERENCES chart (id) ON DELETE CASCADE');
$this->addSql('
ALTER TABLE charts_to_chart_templates
ADD CONSTRAINT FK_8A840E3B5DA0FB8
FOREIGN KEY (chart_template_id)
REFERENCES chart_template (id) ON DELETE CASCADE
');
$this->addSql('DROP TABLE charts_templates');
$this->addSql('DROP TABLE template');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 charts_to_chart_templates DROP FOREIGN KEY FK_8A840E3B5DA0FB8');
$this->addSql('CREATE TABLE charts_templates (chart_id INT NOT NULL, template_id INT NOT NULL, INDEX IDX_3B4D6648BEF83E0A (chart_id), INDEX IDX_3B4D66485DA0FB8 (template_id), PRIMARY KEY(chart_id, template_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE template (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, deleted TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE charts_templates ADD CONSTRAINT FK_3B4D66485DA0FB8 FOREIGN KEY (template_id) REFERENCES template (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE charts_templates ADD CONSTRAINT FK_3B4D6648BEF83E0A FOREIGN KEY (chart_id) REFERENCES chart (id) ON DELETE CASCADE');
$this->addSql('DROP TABLE chart_template');
$this->addSql('DROP TABLE charts_to_chart_templates');
}
}
@@ -0,0 +1,50 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170306085650 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('
CREATE INDEX IDX_8A840E3B9F96B27 ON charts_to_chart_templates (chart_template_id)
');
$this->addSql('
DROP INDEX idx_8a840e3b5da0fb8 ON charts_to_chart_templates
');
// $this->addSql('ALTER TABLE charts_to_chart_templates RENAME INDEX idx_8a840e3b5da0fb8 TO IDX_8A840E3B9F96B27');
$this->addSql('ALTER TABLE users CHANGE number_of_subscriber number_of_subscribers INT NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('
CREATE INDEX IDX_8A840E3B5DA0FB8 ON charts_to_chart_templates (chart_template_id)
');
$this->addSql('
DROP INDEX idx_8a840e3b9f96b27 ON charts_to_chart_templates
');
// $this->addSql('ALTER TABLE charts_to_chart_templates RENAME INDEX idx_8a840e3b9f96b27 TO IDX_8A840E3B5DA0FB8');
$this->addSql('ALTER TABLE users CHANGE number_of_subscribers number_of_subscriber INT NOT NULL');
}
}
@@ -0,0 +1,65 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170306121643 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 documents
ADD point VARCHAR(255) DEFAULT NULL,
ADD duplicates_count INT DEFAULT NULL,
DROP sequence_range,
DROP hashcode,
DROP index_method,
DROP detection_method,
DROP version,
DROP source_resource,
DROP source_last_updated,
DROP source_update_interval,
DROP source_http_status,
DROP strategy_source_setting_update,
DROP strategy_source_setting_index,
DROP source_feed_href,
DROP source_feed_title,
DROP source_feed_format,
DROP permalink_redirect,
DROP permalink_redirect_domain,
DROP permalink_redirect_site,
DROP canonical,
DROP domain,
DROP site,
DROP extract,
DROP extract_length,
DROP extract_checksum,
DROP card,
DROP metadata_score,
CHANGE section section LONGTEXT DEFAULT NULL,
CHANGE source_assigned_tags tags LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\'
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 documents ADD sequence_range BIGINT DEFAULT NULL, ADD hashcode LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci, ADD detection_method VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD version VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD source_resource VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD source_last_updated DATETIME DEFAULT NULL, ADD source_update_interval BIGINT DEFAULT NULL, ADD strategy_source_setting_update VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD strategy_source_setting_index VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD source_feed_href VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD source_feed_title VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD source_feed_format VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD permalink_redirect VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD permalink_redirect_domain VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD permalink_redirect_site VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD canonical VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD domain VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD site VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD extract LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci, ADD extract_length INT DEFAULT NULL, ADD extract_checksum VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD card VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD metadata_score INT DEFAULT NULL, CHANGE section section VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, CHANGE point index_method VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, CHANGE duplicates_count source_http_status INT DEFAULT NULL, CHANGE tags source_assigned_tags LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci COMMENT \'(DC2Type:array)\'');
}
}
@@ -0,0 +1,40 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170309070704 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE analytics_reports_to_feeds (analytic_report_id INT NOT NULL, feed_id INT NOT NULL, INDEX IDX_3613776B6ADC7F69 (analytic_report_id), INDEX IDX_3613776B51A5BC03 (feed_id), PRIMARY KEY(analytic_report_id, feed_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE analytics_reports_to_feeds ADD CONSTRAINT FK_3613776B6ADC7F69 FOREIGN KEY (analytic_report_id) REFERENCES saved_analyse (id)');
$this->addSql('ALTER TABLE analytics_reports_to_feeds ADD CONSTRAINT FK_3613776B51A5BC03 FOREIGN KEY (feed_id) REFERENCES feeds (id)');
$this->addSql('DROP TABLE analytics_reports_to_queries');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('CREATE TABLE analytics_reports_to_queries (analytic_report_id INT NOT NULL, stored_query_id INT NOT NULL, INDEX IDX_1D5B43456ADC7F69 (analytic_report_id), INDEX IDX_1D5B4345C113F4B (stored_query_id), PRIMARY KEY(analytic_report_id, stored_query_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE analytics_reports_to_queries ADD CONSTRAINT FK_1D5B43456ADC7F69 FOREIGN KEY (analytic_report_id) REFERENCES saved_analyse (id)');
$this->addSql('ALTER TABLE analytics_reports_to_queries ADD CONSTRAINT FK_1D5B4345C113F4B FOREIGN KEY (stored_query_id) REFERENCES queries (id)');
$this->addSql('DROP TABLE analytics_reports_to_feeds');
}
}
@@ -0,0 +1,48 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170309093604 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 analytic_reports_to_charts DROP FOREIGN KEY FK_EEB700806ADC7F69');
$this->addSql('ALTER TABLE analytic_reports_to_charts DROP FOREIGN KEY FK_EEB70080BEF83E0A');
$this->addSql('ALTER TABLE analytic_reports_to_charts ADD CONSTRAINT FK_EEB700806ADC7F69 FOREIGN KEY (analytic_report_id) REFERENCES saved_analyse (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE analytic_reports_to_charts ADD CONSTRAINT FK_EEB70080BEF83E0A FOREIGN KEY (chart_id) REFERENCES chart (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE analytics_reports_to_feeds DROP FOREIGN KEY FK_3613776B51A5BC03');
$this->addSql('ALTER TABLE analytics_reports_to_feeds DROP FOREIGN KEY FK_3613776B6ADC7F69');
$this->addSql('ALTER TABLE analytics_reports_to_feeds ADD CONSTRAINT FK_3613776B51A5BC03 FOREIGN KEY (feed_id) REFERENCES feeds (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE analytics_reports_to_feeds ADD CONSTRAINT FK_3613776B6ADC7F69 FOREIGN KEY (analytic_report_id) REFERENCES saved_analyse (id) ON DELETE CASCADE');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 analytic_reports_to_charts DROP FOREIGN KEY FK_EEB700806ADC7F69');
$this->addSql('ALTER TABLE analytic_reports_to_charts DROP FOREIGN KEY FK_EEB70080BEF83E0A');
$this->addSql('ALTER TABLE analytic_reports_to_charts ADD CONSTRAINT FK_EEB700806ADC7F69 FOREIGN KEY (analytic_report_id) REFERENCES saved_analyse (id)');
$this->addSql('ALTER TABLE analytic_reports_to_charts ADD CONSTRAINT FK_EEB70080BEF83E0A FOREIGN KEY (chart_id) REFERENCES chart (id)');
$this->addSql('ALTER TABLE analytics_reports_to_feeds DROP FOREIGN KEY FK_3613776B6ADC7F69');
$this->addSql('ALTER TABLE analytics_reports_to_feeds DROP FOREIGN KEY FK_3613776B51A5BC03');
$this->addSql('ALTER TABLE analytics_reports_to_feeds ADD CONSTRAINT FK_3613776B6ADC7F69 FOREIGN KEY (analytic_report_id) REFERENCES saved_analyse (id)');
$this->addSql('ALTER TABLE analytics_reports_to_feeds ADD CONSTRAINT FK_3613776B51A5BC03 FOREIGN KEY (feed_id) REFERENCES feeds (id)');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170309100456 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 documents DROP bucket, DROP resource, DROP source_date_found, DROP source_last_published, DROP source_last_posted');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 documents ADD bucket BIGINT DEFAULT NULL, ADD resource LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci, ADD source_date_found DATETIME DEFAULT NULL, ADD source_last_published DATETIME DEFAULT NULL, ADD source_last_posted DATETIME DEFAULT NULL');
}
}
@@ -0,0 +1,38 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170309101227 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 saved_analyse ADD user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE saved_analyse ADD CONSTRAINT FK_BF1AC3E9A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_BF1AC3E9A76ED395 ON saved_analyse (user_id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 saved_analyse DROP FOREIGN KEY FK_BF1AC3E9A76ED395');
$this->addSql('DROP INDEX IDX_BF1AC3E9A76ED395 ON saved_analyse');
$this->addSql('ALTER TABLE saved_analyse DROP user_id');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170310101811 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 documents ADD source_publisher_subtype VARCHAR(255) DEFAULT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 documents DROP source_publisher_subtype');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170315135446 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE filters_values (hash VARCHAR(255) NOT NULL, data LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', PRIMARY KEY(hash)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('DROP TABLE filters_values');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170323122000 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 documents ADD source_date_found DATETIME DEFAULT NULL, DROP source_hashcode, DROP source_content_length, DROP source_content_checksum, DROP main_checksum, DROP main_format, DROP description, DROP type');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 documents ADD source_hashcode VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD source_content_length INT DEFAULT NULL, ADD source_content_checksum VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD main_checksum VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD main_format VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD description VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD type VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, DROP source_date_found');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170328120620 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 source_list ADD number_sources INT NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 source_list DROP number_sources');
}
}
@@ -0,0 +1,36 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170328130638 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 sources_to_sources_lists DROP PRIMARY KEY');
$this->addSql('ALTER TABLE sources_to_sources_lists ADD PRIMARY KEY (source_list_id, source_id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 sources_to_sources_lists DROP PRIMARY KEY');
$this->addSql('ALTER TABLE sources_to_sources_lists ADD PRIMARY KEY (source_id, source_list_id)');
}
}
@@ -0,0 +1,52 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170331135621 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 sources_to_sections DROP FOREIGN KEY FK_475C417ED823E37A');
$this->addSql('ALTER TABLE sources_to_sections DROP FOREIGN KEY FK_475C417E953C1C61');
$this->addSql('ALTER TABLE sources_to_sources_lists DROP FOREIGN KEY FK_6411C8FE953C1C61');
$this->addSql('CREATE TABLE cross_sources_source_lists (source VARCHAR(255) NOT NULL, list_id INT NOT NULL, INDEX IDX_5972F68E3DAE168B (list_id), PRIMARY KEY(source, list_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE cross_sources_source_lists ADD CONSTRAINT FK_5972F68E3DAE168B FOREIGN KEY (list_id) REFERENCES source_list (id)');
$this->addSql('DROP TABLE sections');
$this->addSql('DROP TABLE sources');
$this->addSql('DROP TABLE sources_to_sections');
$this->addSql('DROP TABLE sources_to_sources_lists');
$this->addSql('ALTER TABLE source_list ADD source_number INT NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('CREATE TABLE sections (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE sources (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, license VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, country VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, rank INT NOT NULL, url VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, source_publisher_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, state VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, city VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, lang VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, deleted TINYINT(1) NOT NULL, INDEX source_search_idx (title, type), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE sources_to_sections (source_id INT NOT NULL, section_id INT NOT NULL, INDEX IDX_475C417E953C1C61 (source_id), INDEX IDX_475C417ED823E37A (section_id), PRIMARY KEY(source_id, section_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE sources_to_sources_lists (source_list_id INT NOT NULL, source_id INT NOT NULL, INDEX IDX_6411C8FE953C1C61 (source_id), INDEX IDX_6411C8FE7471AEE3 (source_list_id), PRIMARY KEY(source_list_id, source_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE sources_to_sections ADD CONSTRAINT FK_475C417E953C1C61 FOREIGN KEY (source_id) REFERENCES sources (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE sources_to_sections ADD CONSTRAINT FK_475C417ED823E37A FOREIGN KEY (section_id) REFERENCES sections (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE sources_to_sources_lists ADD CONSTRAINT FK_6411C8FE7471AEE3 FOREIGN KEY (source_list_id) REFERENCES source_list (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE sources_to_sources_lists ADD CONSTRAINT FK_6411C8FE953C1C61 FOREIGN KEY (source_id) REFERENCES sources (id) ON DELETE CASCADE');
$this->addSql('DROP TABLE cross_sources_source_lists');
$this->addSql('ALTER TABLE source_list DROP source_number');
}
}
@@ -0,0 +1,38 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170411131958 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 source_list ADD updated_by_id INT DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE source_list ADD CONSTRAINT FK_45427D1B896DBBDE FOREIGN KEY (updated_by_id) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_45427D1B896DBBDE ON source_list (updated_by_id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 source_list DROP FOREIGN KEY FK_45427D1B896DBBDE');
$this->addSql('DROP INDEX IDX_45427D1B896DBBDE ON source_list');
$this->addSql('ALTER TABLE source_list DROP updated_by_id, CHANGE updated_at updated_at DATETIME NOT NULL');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170414125354 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 cross_sources_source_lists CHANGE source source VARBINARY(255) NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 cross_sources_source_lists CHANGE source source VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
}
}
@@ -0,0 +1,54 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170418123149 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE notifications (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, subject VARCHAR(255) DEFAULT NULL, automated_subject TINYINT(1) NOT NULL, published TINYINT(1) NOT NULL, allow_unsubscribe TINYINT(1) NOT NULL, unsubscribe_notification TINYINT(1) NOT NULL, enhanced_html TINYINT(1) NOT NULL, send_when_empty TINYINT(1) NOT NULL, timezone VARCHAR(255) NOT NULL, send_until DATE DEFAULT NULL, active TINYINT(1) NOT NULL, type VARCHAR(255) NOT NULL, article_extracts VARCHAR(11) DEFAULT NULL, highlight_keywords TINYINT(1) DEFAULT NULL, show_source_country TINYINT(1) DEFAULT NULL, show_user_comments TINYINT(1) DEFAULT NULL, show_paragraph_breaks TINYINT(1) DEFAULT NULL, INDEX IDX_6000B0D37E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE abstract_notification_user (abstract_notification_id INT NOT NULL, user_id INT NOT NULL, INDEX IDX_D77AF04D25D4BF91 (abstract_notification_id), INDEX IDX_D77AF04DA76ED395 (user_id), PRIMARY KEY(abstract_notification_id, user_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE abstract_notification_abstract_feed (abstract_notification_id INT NOT NULL, abstract_feed_id INT NOT NULL, INDEX IDX_897CC52225D4BF91 (abstract_notification_id), INDEX IDX_897CC522F312DA93 (abstract_feed_id), PRIMARY KEY(abstract_notification_id, abstract_feed_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE abstract_notification_chart (abstract_notification_id INT NOT NULL, chart_id INT NOT NULL, INDEX IDX_E261071525D4BF91 (abstract_notification_id), INDEX IDX_E2610715BEF83E0A (chart_id), PRIMARY KEY(abstract_notification_id, chart_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE notification_schedule (id INT AUTO_INCREMENT NOT NULL, notification_id INT DEFAULT NULL, day VARCHAR(10) NOT NULL, time INT NOT NULL, periodically TINYINT(1) NOT NULL, INDEX IDX_F28295EEF1A9D84 (notification_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE notifications ADD CONSTRAINT FK_6000B0D37E3C61F9 FOREIGN KEY (owner_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE abstract_notification_user ADD CONSTRAINT FK_D77AF04D25D4BF91 FOREIGN KEY (abstract_notification_id) REFERENCES notifications (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE abstract_notification_user ADD CONSTRAINT FK_D77AF04DA76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE abstract_notification_abstract_feed ADD CONSTRAINT FK_897CC52225D4BF91 FOREIGN KEY (abstract_notification_id) REFERENCES notifications (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE abstract_notification_abstract_feed ADD CONSTRAINT FK_897CC522F312DA93 FOREIGN KEY (abstract_feed_id) REFERENCES feeds (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE abstract_notification_chart ADD CONSTRAINT FK_E261071525D4BF91 FOREIGN KEY (abstract_notification_id) REFERENCES notifications (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE abstract_notification_chart ADD CONSTRAINT FK_E2610715BEF83E0A FOREIGN KEY (chart_id) REFERENCES chart (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE notification_schedule ADD CONSTRAINT FK_F28295EEF1A9D84 FOREIGN KEY (notification_id) REFERENCES notifications (id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 abstract_notification_user DROP FOREIGN KEY FK_D77AF04D25D4BF91');
$this->addSql('ALTER TABLE abstract_notification_abstract_feed DROP FOREIGN KEY FK_897CC52225D4BF91');
$this->addSql('ALTER TABLE abstract_notification_chart DROP FOREIGN KEY FK_E261071525D4BF91');
$this->addSql('ALTER TABLE notification_schedule DROP FOREIGN KEY FK_F28295EEF1A9D84');
$this->addSql('DROP TABLE notifications');
$this->addSql('DROP TABLE abstract_notification_user');
$this->addSql('DROP TABLE abstract_notification_abstract_feed');
$this->addSql('DROP TABLE abstract_notification_chart');
$this->addSql('DROP TABLE notification_schedule');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170418140509 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 notifications ADD sources_count INT NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 notifications DROP sources_count');
}
}
@@ -0,0 +1,62 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170421093942 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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\'.');
// Drop primary key and foreign key indexes.
$this->addSql('ALTER TABLE pages DROP FOREIGN KEY FK_2074E575C33F7837');
$this->addSql('ALTER TABLE documents DROP PRIMARY KEY');
$this->addSql('ALTER TABLE documents CHANGE sequence sequence BIGINT NOT NULL');
$this->addSql('ALTER TABLE pages CHANGE document_id document_id BIGINT DEFAULT NULL');
// Return indexes back.
$this->addSql('ALTER TABLE documents ADD PRIMARY KEY(sequence)');
$this->addSql('
ALTER TABLE pages
ADD CONSTRAINT FK_2074E575C33F7837
FOREIGN KEY (document_id) REFERENCES documents (sequence)
');
$this->addSql('ALTER TABLE filters_values ADD expires_at DATETIME NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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\'.');
// Drop primary key and foreign key indexes.
$this->addSql('ALTER TABLE pages DROP FOREIGN KEY FK_2074E575C33F7837');
$this->addSql('ALTER TABLE documents DROP PRIMARY KEY');
$this->addSql('ALTER TABLE documents CHANGE sequence sequence VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('ALTER TABLE pages CHANGE document_id document_id VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci');
// Return indexes back.
$this->addSql('ALTER TABLE documents ADD PRIMARY KEY(sequence)');
$this->addSql('
ALTER TABLE pages
ADD CONSTRAINT FK_2074E575C33F7837
FOREIGN KEY (document_id) REFERENCES documents (sequence)
');
$this->addSql('ALTER TABLE filters_values DROP expires_at');
}
}
@@ -0,0 +1,42 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170421133622 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 queries
ADD raw_filters LONGTEXT NOT NULL COMMENT \'(DC2Type:json_array)\',
ADD raw_advanced_filters LONGTEXT NOT NULL COMMENT \'(DC2Type:json_array)\'
');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 queries
DROP raw_filters,
DROP raw_advanced_filters
');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170424141108 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 feeds ADD normalized_filters LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\'');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 feeds DROP normalized_filters');
}
}
@@ -0,0 +1,36 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170525100045 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 queries ADD external_filters LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\'');
$this->addSql('ALTER TABLE feeds DROP normalized_filters');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 feeds ADD normalized_filters LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci COMMENT \'(DC2Type:array)\'');
$this->addSql('ALTER TABLE queries DROP external_filters');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170601052151 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 documents ADD source_hashcode VARCHAR(255) DEFAULT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 documents DROP source_hashcode');
}
}
@@ -0,0 +1,50 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170621133416 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE notifications_history (id INT AUTO_INCREMENT NOT NULL, notification_id INT DEFAULT NULL, date DATETIME NOT NULL, INDEX IDX_6227D824EF1A9D84 (notification_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE notifications_history ADD CONSTRAINT FK_6227D824EF1A9D84 FOREIGN KEY (notification_id) REFERENCES notifications (id)');
$this->addSql('ALTER TABLE site_settings ADD section VARCHAR(255) NOT NULL, CHANGE value value LONGTEXT NOT NULL');
$this->addSql('ALTER TABLE notifications ADD created_at DATETIME NOT NULL, ADD last_sent_at DATETIME NOT NULL, CHANGE timezone timezone VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE notification_schedule ADD type VARCHAR(255) NOT NULL, ADD days VARCHAR(9) DEFAULT NULL, ADD period VARCHAR(7) DEFAULT NULL, ADD hour SMALLINT DEFAULT NULL, ADD minute SMALLINT DEFAULT NULL, DROP periodically, CHANGE day day VARCHAR(10) DEFAULT NULL, CHANGE time time VARCHAR(5) DEFAULT NULL');
//
// Create table for string scheduling. This table don't have ORM mapping.
//
$table = $schema->createTable('internal_notification_scheduling');
$table->addColumn('notification_id', 'integer');
$table->addColumn('date', 'datetime');
$table->addForeignKeyConstraint('notifications', [ 'notification_id' ], [ 'id' ]);
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('DROP TABLE notifications_history');
$this->addSql('DROP TABLE internal_notification_scheduling');
$this->addSql('ALTER TABLE notification_schedule ADD periodically TINYINT(1) NOT NULL, DROP type, DROP days, DROP period, DROP hour, DROP minute, CHANGE time time INT NOT NULL, CHANGE day day VARCHAR(10) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('ALTER TABLE notifications DROP created_at, DROP last_sent_at, CHANGE timezone timezone VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('ALTER TABLE site_settings DROP section, CHANGE value value VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
}
}
@@ -0,0 +1,36 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170622142328 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE comments (id INT AUTO_INCREMENT NOT NULL, document_id BIGINT DEFAULT NULL, author_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, content LONGTEXT NOT NULL, create_at DATETIME NOT NULL, INDEX IDX_5F9E962AC33F7837 (document_id), INDEX IDX_5F9E962AF675F31B (author_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE comments ADD CONSTRAINT FK_5F9E962AC33F7837 FOREIGN KEY (document_id) REFERENCES documents (sequence)');
$this->addSql('ALTER TABLE comments ADD CONSTRAINT FK_5F9E962AF675F31B FOREIGN KEY (author_id) REFERENCES users (id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('DROP TABLE comments');
}
}
@@ -0,0 +1,38 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170623141928 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 comments ADD new TINYINT(1) NOT NULL');
$this->addSql('DELETE FROM comments');
$this->addSql('ALTER TABLE documents ADD comments_count INT NOT NULL');
$this->addSql('UPDATE documents SET comments_count = 0');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 comments DROP new');
$this->addSql('ALTER TABLE documents DROP comments_count');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170626123406 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 comments CHANGE create_at created_at DATETIME NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 comments CHANGE created_at create_at DATETIME NOT NULL');
}
}
@@ -0,0 +1,40 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170627072351 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 pages ADD clip_feed_id INT DEFAULT NULL, DROP score');
$this->addSql('ALTER TABLE pages ADD CONSTRAINT FK_2074E575E3491210 FOREIGN KEY (clip_feed_id) REFERENCES feeds (id)');
$this->addSql('CREATE INDEX IDX_2074E575E3491210 ON pages (clip_feed_id)');
$this->addSql('ALTER TABLE feeds ADD filters LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', ADD total_count INT DEFAULT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 feeds DROP filters, DROP total_count');
$this->addSql('ALTER TABLE pages DROP FOREIGN KEY FK_2074E575E3491210');
$this->addSql('DROP INDEX IDX_2074E575E3491210 ON pages');
$this->addSql('ALTER TABLE pages ADD score DOUBLE PRECISION NOT NULL, DROP clip_feed_id');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170627094317 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 feeds ADD raw_filters LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 feeds DROP raw_filters');
}
}
@@ -0,0 +1,36 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170628113424 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE recently_used_feeds (id INT AUTO_INCREMENT NOT NULL, feed_id INT DEFAULT NULL, user_id INT DEFAULT NULL, used_at DATETIME NOT NULL, INDEX IDX_7329C41B51A5BC03 (feed_id), INDEX IDX_7329C41BA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE recently_used_feeds ADD CONSTRAINT FK_7329C41B51A5BC03 FOREIGN KEY (feed_id) REFERENCES feeds (id)');
$this->addSql('ALTER TABLE recently_used_feeds ADD CONSTRAINT FK_7329C41BA76ED395 FOREIGN KEY (user_id) REFERENCES users (id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('DROP TABLE recently_used_feeds');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170628132350 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE emailed_documents (id INT AUTO_INCREMENT NOT NULL, email_to LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', email_reply_to VARCHAR(255) NOT NULL, subject VARCHAR(255) DEFAULT NULL, content LONGTEXT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('DROP TABLE emailed_documents');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170710081331 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 feeds ADD exported TINYINT(1) NOT NULL');
$this->addSql('UPDATE feeds SET exported = false');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 feeds DROP exported');
}
}
@@ -0,0 +1,80 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170718143600 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE cross_notifications_feeds (notification_id INT NOT NULL, abstract_feed_id INT NOT NULL, INDEX IDX_36DBBC7CEF1A9D84 (notification_id), INDEX IDX_36DBBC7CF312DA93 (abstract_feed_id), PRIMARY KEY(notification_id, abstract_feed_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE cross_notifications_charts (notification_id INT NOT NULL, chart_id INT NOT NULL, INDEX IDX_325EA2F0EF1A9D84 (notification_id), INDEX IDX_325EA2F0BEF83E0A (chart_id), PRIMARY KEY(notification_id, chart_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE notification_themes (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, `default` TINYINT(1) NOT NULL, enhanced_summary LONGTEXT NOT NULL, enhanced_conclusion LONGTEXT NOT NULL, enhanced_header LONGTEXT NOT NULL COMMENT \'(DC2Type:object)\', enhanced_fonts LONGTEXT NOT NULL COMMENT \'(DC2Type:object)\', enhanced_content LONGTEXT NOT NULL COMMENT \'(DC2Type:object)\', enhanced_colors LONGTEXT NOT NULL COMMENT \'(DC2Type:object)\', plain_summary LONGTEXT NOT NULL, plain_conclusion LONGTEXT NOT NULL, plain_header LONGTEXT NOT NULL COMMENT \'(DC2Type:object)\', plain_fonts LONGTEXT NOT NULL COMMENT \'(DC2Type:object)\', plain_content LONGTEXT NOT NULL COMMENT \'(DC2Type:object)\', plain_colors LONGTEXT NOT NULL COMMENT \'(DC2Type:object)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE recipients (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, subscribed_count LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', created_at DATETIME NOT NULL, active TINYINT(1) NOT NULL, type VARCHAR(255) NOT NULL, first_name VARCHAR(255) DEFAULT NULL, last_name VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, description LONGTEXT DEFAULT NULL, persons_count INT DEFAULT NULL, INDEX IDX_146632C47E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE cross_recipient_notifications (abstract_recipient_id INT NOT NULL, notification_id INT NOT NULL, INDEX IDX_CAECF31E7A443649 (abstract_recipient_id), INDEX IDX_CAECF31EEF1A9D84 (notification_id), PRIMARY KEY(abstract_recipient_id, notification_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE cross_groups_persons (group_recipient_id INT NOT NULL, person_recipient_id INT NOT NULL, INDEX IDX_E37D3AB7569C541 (group_recipient_id), INDEX IDX_E37D3AB7A216F35 (person_recipient_id), PRIMARY KEY(group_recipient_id, person_recipient_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE cross_notifications_feeds ADD CONSTRAINT FK_36DBBC7CEF1A9D84 FOREIGN KEY (notification_id) REFERENCES notifications (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE cross_notifications_feeds ADD CONSTRAINT FK_36DBBC7CF312DA93 FOREIGN KEY (abstract_feed_id) REFERENCES feeds (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE cross_notifications_charts ADD CONSTRAINT FK_325EA2F0EF1A9D84 FOREIGN KEY (notification_id) REFERENCES notifications (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE cross_notifications_charts ADD CONSTRAINT FK_325EA2F0BEF83E0A FOREIGN KEY (chart_id) REFERENCES chart (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE recipients ADD CONSTRAINT FK_146632C47E3C61F9 FOREIGN KEY (owner_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE cross_recipient_notifications ADD CONSTRAINT FK_CAECF31E7A443649 FOREIGN KEY (abstract_recipient_id) REFERENCES recipients (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE cross_recipient_notifications ADD CONSTRAINT FK_CAECF31EEF1A9D84 FOREIGN KEY (notification_id) REFERENCES notifications (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE cross_groups_persons ADD CONSTRAINT FK_E37D3AB7569C541 FOREIGN KEY (group_recipient_id) REFERENCES recipients (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE cross_groups_persons ADD CONSTRAINT FK_E37D3AB7A216F35 FOREIGN KEY (person_recipient_id) REFERENCES recipients (id) ON DELETE CASCADE');
$this->addSql('DROP TABLE abstract_notification_abstract_feed');
$this->addSql('DROP TABLE abstract_notification_chart');
$this->addSql('DROP TABLE abstract_notification_user');
$this->addSql('ALTER TABLE notifications ADD theme_id INT DEFAULT NULL, ADD notification_type VARCHAR(255) NOT NULL, ADD theme_type VARCHAR(255) NOT NULL, ADD enhanced_theme_options_diff LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', ADD plain_theme_options_diff LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', DROP enhanced_html, DROP type, DROP article_extracts, DROP highlight_keywords, DROP show_source_country, DROP show_user_comments, DROP show_paragraph_breaks, CHANGE timezone timezone VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE notifications ADD CONSTRAINT FK_6000B0D359027487 FOREIGN KEY (theme_id) REFERENCES notification_themes (id)');
$this->addSql('CREATE INDEX IDX_6000B0D359027487 ON notifications (theme_id)');
$this->addSql('ALTER TABLE users ADD recipient_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE users ADD CONSTRAINT FK_1483A5E9E92F8F78 FOREIGN KEY (recipient_id) REFERENCES recipients (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1483A5E9E92F8F78 ON users (recipient_id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 notifications DROP FOREIGN KEY FK_6000B0D359027487');
$this->addSql('ALTER TABLE cross_recipient_notifications DROP FOREIGN KEY FK_CAECF31E7A443649');
$this->addSql('ALTER TABLE cross_groups_persons DROP FOREIGN KEY FK_E37D3AB7569C541');
$this->addSql('ALTER TABLE cross_groups_persons DROP FOREIGN KEY FK_E37D3AB7A216F35');
$this->addSql('ALTER TABLE users DROP FOREIGN KEY FK_1483A5E9E92F8F78');
$this->addSql('CREATE TABLE abstract_notification_abstract_feed (abstract_notification_id INT NOT NULL, abstract_feed_id INT NOT NULL, INDEX IDX_897CC52225D4BF91 (abstract_notification_id), INDEX IDX_897CC522F312DA93 (abstract_feed_id), PRIMARY KEY(abstract_notification_id, abstract_feed_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE abstract_notification_chart (abstract_notification_id INT NOT NULL, chart_id INT NOT NULL, INDEX IDX_E261071525D4BF91 (abstract_notification_id), INDEX IDX_E2610715BEF83E0A (chart_id), PRIMARY KEY(abstract_notification_id, chart_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE abstract_notification_user (abstract_notification_id INT NOT NULL, user_id INT NOT NULL, INDEX IDX_D77AF04D25D4BF91 (abstract_notification_id), INDEX IDX_D77AF04DA76ED395 (user_id), PRIMARY KEY(abstract_notification_id, user_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE abstract_notification_abstract_feed ADD CONSTRAINT FK_897CC52225D4BF91 FOREIGN KEY (abstract_notification_id) REFERENCES notifications (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE abstract_notification_abstract_feed ADD CONSTRAINT FK_897CC522F312DA93 FOREIGN KEY (abstract_feed_id) REFERENCES feeds (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE abstract_notification_chart ADD CONSTRAINT FK_E261071525D4BF91 FOREIGN KEY (abstract_notification_id) REFERENCES notifications (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE abstract_notification_chart ADD CONSTRAINT FK_E2610715BEF83E0A FOREIGN KEY (chart_id) REFERENCES chart (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE abstract_notification_user ADD CONSTRAINT FK_D77AF04D25D4BF91 FOREIGN KEY (abstract_notification_id) REFERENCES notifications (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE abstract_notification_user ADD CONSTRAINT FK_D77AF04DA76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE');
$this->addSql('DROP TABLE cross_notifications_feeds');
$this->addSql('DROP TABLE cross_notifications_charts');
$this->addSql('DROP TABLE notification_themes');
$this->addSql('DROP TABLE recipients');
$this->addSql('DROP TABLE cross_recipient_notifications');
$this->addSql('DROP TABLE cross_groups_persons');
$this->addSql('DROP INDEX IDX_6000B0D359027487 ON notifications');
$this->addSql('ALTER TABLE notifications ADD enhanced_html TINYINT(1) NOT NULL, ADD type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, ADD article_extracts VARCHAR(11) DEFAULT NULL COLLATE utf8_unicode_ci, ADD highlight_keywords TINYINT(1) DEFAULT NULL, ADD show_source_country TINYINT(1) DEFAULT NULL, ADD show_user_comments TINYINT(1) DEFAULT NULL, ADD show_paragraph_breaks TINYINT(1) DEFAULT NULL, DROP theme_id, DROP notification_type, DROP theme_type, DROP enhanced_theme_options_diff, DROP plain_theme_options_diff, CHANGE timezone timezone VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('DROP INDEX UNIQ_1483A5E9E92F8F78 ON users');
$this->addSql('ALTER TABLE users DROP recipient_id');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170720105420 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 notification_themes ADD published TINYINT(1) NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 notification_themes DROP published');
}
}
@@ -0,0 +1,36 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170726083859 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE user_organization (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, organization_id INT NOT NULL, roles VARCHAR(255) NOT NULL, billing_plan VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE organizations (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_427C1C7F5E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('DROP TABLE user_organization');
$this->addSql('DROP TABLE organizations');
}
}
@@ -0,0 +1,35 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170728104833 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 organizations ADD organization_address VARCHAR(255) NOT NULL, ADD organization_email VARCHAR(255) NOT NULL, ADD organization_phone VARCHAR(255) NOT NULL, CHANGE name organization_name VARCHAR(255) NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 notifications CHANGE notification_type notification_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE theme_type theme_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE timezone timezone VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('ALTER TABLE organizations ADD name VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, DROP organization_name, DROP organization_address, DROP organization_email, DROP organization_phone');
$this->addSql('CREATE UNIQUE INDEX UNIQ_427C1C7F5E237E06 ON organizations (name)');
}
}
@@ -0,0 +1,36 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170731082044 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 users ADD private_person TINYINT(1) NOT NULL, ADD billing_plan_id INT NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 notifications CHANGE notification_type notification_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE theme_type theme_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE timezone timezone VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('ALTER TABLE users DROP private_person, DROP billing_plan_id');
}
}
@@ -0,0 +1,42 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170801062855 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE subscription (id INT AUTO_INCREMENT NOT NULL, plan_id INT NOT NULL, type INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE plan (id INT AUTO_INCREMENT NOT NULL, limitPlan INT NOT NULL, price DOUBLE PRECISION NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('DROP TABLE user_organization');
$this->addSql('ALTER TABLE users DROP billing_plan_id');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('CREATE TABLE user_organization (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, organization_id INT NOT NULL, roles VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, billing_plan VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('DROP TABLE subscription');
$this->addSql('DROP TABLE plan');
$this->addSql('ALTER TABLE notifications CHANGE notification_type notification_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE theme_type theme_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE timezone timezone VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('ALTER TABLE users ADD billing_plan_id INT NOT NULL');
}
}
@@ -0,0 +1,40 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170801070731 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 subscription CHANGE plan_id plan_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE subscription ADD CONSTRAINT FK_A3C664D3E899029B FOREIGN KEY (plan_id) REFERENCES plan (id)');
$this->addSql('CREATE INDEX IDX_A3C664D3E899029B ON subscription (plan_id)');
$this->addSql('ALTER TABLE notifications CHANGE timezone timezone VARCHAR(255) NOT NULL, CHANGE notification_type notification_type VARCHAR(255) NOT NULL, CHANGE theme_type theme_type VARCHAR(255) NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 notifications CHANGE notification_type notification_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE theme_type theme_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE timezone timezone VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('ALTER TABLE subscription DROP FOREIGN KEY FK_A3C664D3E899029B');
$this->addSql('DROP INDEX IDX_A3C664D3E899029B ON subscription');
$this->addSql('ALTER TABLE subscription CHANGE plan_id plan_id INT NOT NULL');
}
}
@@ -0,0 +1,44 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170801074039 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 subscription ADD organization_id INT DEFAULT NULL, ADD user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE subscription ADD CONSTRAINT FK_A3C664D332C8A3DE FOREIGN KEY (organization_id) REFERENCES organizations (id)');
$this->addSql('ALTER TABLE subscription ADD CONSTRAINT FK_A3C664D3A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_A3C664D332C8A3DE ON subscription (organization_id)');
$this->addSql('CREATE INDEX IDX_A3C664D3A76ED395 ON subscription (user_id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 notifications CHANGE notification_type notification_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE theme_type theme_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE timezone timezone VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('ALTER TABLE subscription DROP FOREIGN KEY FK_A3C664D332C8A3DE');
$this->addSql('ALTER TABLE subscription DROP FOREIGN KEY FK_A3C664D3A76ED395');
$this->addSql('DROP INDEX IDX_A3C664D332C8A3DE ON subscription');
$this->addSql('DROP INDEX IDX_A3C664D3A76ED395 ON subscription');
$this->addSql('ALTER TABLE subscription DROP organization_id, DROP user_id');
}
}
@@ -0,0 +1,42 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170801102300 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 users DROP private_person');
$this->addSql('ALTER TABLE subscription ADD organization_address VARCHAR(255) NOT NULL, ADD organization_email VARCHAR(255) NOT NULL, ADD organization_phone VARCHAR(255) NOT NULL, DROP type');
$this->addSql('ALTER TABLE notifications CHANGE timezone timezone VARCHAR(255) NOT NULL, CHANGE notification_type notification_type VARCHAR(255) NOT NULL, CHANGE theme_type theme_type VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE plan DROP limitPlan');
$this->addSql('ALTER TABLE organizations DROP organization_address, DROP organization_email, DROP organization_phone');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 notifications CHANGE notification_type notification_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE theme_type theme_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE timezone timezone VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('ALTER TABLE organizations ADD organization_address VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, ADD organization_email VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, ADD organization_phone VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('ALTER TABLE plan ADD limitPlan INT NOT NULL');
$this->addSql('ALTER TABLE subscription ADD type INT NOT NULL, DROP organization_address, DROP organization_email, DROP organization_phone');
$this->addSql('ALTER TABLE users ADD private_person TINYINT(1) NOT NULL');
}
}
@@ -0,0 +1,44 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170801113442 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE subscriptions (id INT AUTO_INCREMENT NOT NULL, plan_id INT DEFAULT NULL, organization_id INT DEFAULT NULL, user_id INT DEFAULT NULL, type VARCHAR(255) NOT NULL, organization_address VARCHAR(255) DEFAULT NULL, organization_email VARCHAR(255) DEFAULT NULL, organization_phone VARCHAR(255) DEFAULT NULL, INDEX IDX_4778A01E899029B (plan_id), INDEX IDX_4778A0132C8A3DE (organization_id), INDEX IDX_4778A01A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE subscriptions ADD CONSTRAINT FK_4778A01E899029B FOREIGN KEY (plan_id) REFERENCES plan (id)');
$this->addSql('ALTER TABLE subscriptions ADD CONSTRAINT FK_4778A0132C8A3DE FOREIGN KEY (organization_id) REFERENCES organizations (id)');
$this->addSql('ALTER TABLE subscriptions ADD CONSTRAINT FK_4778A01A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)');
$this->addSql('DROP TABLE subscription');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('CREATE TABLE subscription (id INT AUTO_INCREMENT NOT NULL, organization_id INT DEFAULT NULL, user_id INT DEFAULT NULL, plan_id INT DEFAULT NULL, organization_address VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, organization_email VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, organization_phone VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, INDEX IDX_A3C664D3E899029B (plan_id), INDEX IDX_A3C664D332C8A3DE (organization_id), INDEX IDX_A3C664D3A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE subscription ADD CONSTRAINT FK_A3C664D332C8A3DE FOREIGN KEY (organization_id) REFERENCES organizations (id)');
$this->addSql('ALTER TABLE subscription ADD CONSTRAINT FK_A3C664D3A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE subscription ADD CONSTRAINT FK_A3C664D3E899029B FOREIGN KEY (plan_id) REFERENCES plan (id)');
$this->addSql('DROP TABLE subscriptions');
$this->addSql('ALTER TABLE notifications CHANGE notification_type notification_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE theme_type theme_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE timezone timezone VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
}
}
@@ -0,0 +1,52 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170801125743 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 source_list DROP number_sources, CHANGE source_number source_number INT NOT NULL');
$this->addSql('ALTER TABLE plan ADD name VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE notifications ADD billing_subscription_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE notifications ADD CONSTRAINT FK_6000B0D3CF9564CB FOREIGN KEY (billing_subscription_id) REFERENCES subscriptions (id)');
$this->addSql('CREATE INDEX IDX_6000B0D3CF9564CB ON notifications (billing_subscription_id)');
$this->addSql('DROP INDEX UNIQ_427C1C7F5E237E06 ON organizations');
$this->addSql('ALTER TABLE organizations CHANGE organization_name name VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE users ADD billing_subscription_id INT DEFAULT NULL, DROP organization');
$this->addSql('ALTER TABLE users ADD CONSTRAINT FK_1483A5E9CF9564CB FOREIGN KEY (billing_subscription_id) REFERENCES subscriptions (id)');
$this->addSql('CREATE INDEX IDX_1483A5E9CF9564CB ON users (billing_subscription_id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 notifications DROP FOREIGN KEY FK_6000B0D3CF9564CB');
$this->addSql('DROP INDEX IDX_6000B0D3CF9564CB ON notifications');
$this->addSql('ALTER TABLE notifications DROP billing_subscription_id');
$this->addSql('ALTER TABLE organizations CHANGE name organization_name VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('CREATE UNIQUE INDEX UNIQ_427C1C7F5E237E06 ON organizations (organization_name)');
$this->addSql('ALTER TABLE plan DROP name');
$this->addSql('ALTER TABLE source_list ADD number_sources INT DEFAULT NULL, CHANGE source_number source_number INT DEFAULT NULL');
$this->addSql('ALTER TABLE users DROP FOREIGN KEY FK_1483A5E9CF9564CB');
$this->addSql('DROP INDEX IDX_1483A5E9CF9564CB ON users');
$this->addSql('ALTER TABLE users ADD organization VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, DROP billing_subscription_id');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170802062009 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 recipients CHANGE persons_count recipients_number INT DEFAULT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 recipients CHANGE recipients_number persons_count INT DEFAULT NULL');
}
}
@@ -0,0 +1,41 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170803125221 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 notification_schedule ADD history_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE notification_schedule ADD CONSTRAINT FK_F28295E1E058452 FOREIGN KEY (history_id) REFERENCES notifications_history (id)');
$this->addSql('CREATE INDEX IDX_F28295E1E058452 ON notification_schedule (history_id)');
$this->addSql('ALTER TABLE internal_notification_scheduling ADD schedules LONGTEXT NOT NULL');
$this->addSql('UPDATE internal_notification_scheduling SET schedules = \'\'');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 notification_schedule DROP FOREIGN KEY FK_F28295E1E058452');
$this->addSql('DROP INDEX IDX_F28295E1E058452 ON notification_schedule');
$this->addSql('ALTER TABLE notification_schedule DROP history_id');
$this->addSql('ALTER TABLE internal_notification_scheduling DROP schedules');
}
}
@@ -0,0 +1,35 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170807041246 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 plan ADD searches_per_day INT NOT NULL, ADD saved_feeds INT NOT NULL, ADD master_accounts INT NOT NULL, ADD subscriber_accounts INT NOT NULL, ADD alerts INT NOT NULL, ADD newsletters INT NOT NULL, ADD analytics TINYINT(1) NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 notifications CHANGE notification_type notification_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE theme_type theme_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE timezone timezone VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('ALTER TABLE plan DROP searches_per_day, DROP saved_feeds, DROP master_accounts, DROP subscriber_accounts, DROP alerts, DROP newsletters, DROP analytics');
}
}
@@ -0,0 +1,34 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170809114318 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 subscriptions ADD searches_per_day INT NOT NULL, ADD saved_feeds INT NOT NULL, ADD master_accounts INT NOT NULL, ADD subscriber_accounts INT NOT NULL, ADD alerts INT NOT NULL, ADD newsletters INT NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 subscriptions DROP searches_per_day, DROP saved_feeds, DROP master_accounts, DROP subscriber_accounts, DROP alerts, DROP newsletters');
}
}
@@ -0,0 +1,36 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170810054937 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 users ADD verifyed TINYINT(1) NOT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 notifications CHANGE notification_type notification_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE theme_type theme_type VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, CHANGE timezone timezone VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
$this->addSql('ALTER TABLE users DROP verifyed');
}
}
@@ -0,0 +1,35 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170810055624 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 users CHANGE verifyed verified TINYINT(1) NOT NULL');
$this->addSql('UPDATE users SET verified = true');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 users CHANGE verified verifyed TINYINT(1) NOT NULL');
}
}
@@ -0,0 +1,38 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170810065300 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE payment_tokens (hash VARCHAR(255) NOT NULL, details LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:object)\', after_url LONGTEXT DEFAULT NULL, target_url LONGTEXT NOT NULL, gateway_name VARCHAR(255) NOT NULL, PRIMARY KEY(hash)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE payments (id INT AUTO_INCREMENT NOT NULL, number VARCHAR(255) DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, client_email VARCHAR(255) DEFAULT NULL, client_id VARCHAR(255) DEFAULT NULL, total_amount INT DEFAULT NULL, currency_code VARCHAR(255) DEFAULT NULL, details LONGTEXT NOT NULL COMMENT \'(DC2Type:json_array)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('DROP TABLE payment_tokens');
$this->addSql('DROP TABLE payments');
}
}
@@ -0,0 +1,53 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170810124714 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('DROP TABLE jobs');
$this->addSql('ALTER TABLE subscriptions DROP FOREIGN KEY FK_4778A01A76ED395');
$this->addSql('DROP INDEX IDX_4778A01A76ED395 ON subscriptions');
$this->addSql('ALTER TABLE subscriptions CHANGE user_id owner_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE subscriptions ADD CONSTRAINT FK_4778A017E3C61F9 FOREIGN KEY (owner_id) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_4778A017E3C61F9 ON subscriptions (owner_id)');
$this->addSql('ALTER TABLE recipients DROP FOREIGN KEY FK_146632C47E3C61F9');
$this->addSql('ALTER TABLE recipients ADD CONSTRAINT FK_146632C47E3C61F9 FOREIGN KEY (owner_id) REFERENCES users (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE users DROP FOREIGN KEY FK_1483A5E9CF9564CB');
$this->addSql('ALTER TABLE users ADD CONSTRAINT FK_1483A5E9CF9564CB FOREIGN KEY (billing_subscription_id) REFERENCES subscriptions (id) ON DELETE SET NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('CREATE TABLE jobs (id INT AUTO_INCREMENT NOT NULL, query_id INT DEFAULT NULL, INDEX IDX_A8936DC5EF946F99 (query_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE jobs ADD CONSTRAINT FK_A8936DC5EF946F99 FOREIGN KEY (query_id) REFERENCES queries (id)');
$this->addSql('ALTER TABLE recipients DROP FOREIGN KEY FK_146632C47E3C61F9');
$this->addSql('ALTER TABLE recipients ADD CONSTRAINT FK_146632C47E3C61F9 FOREIGN KEY (owner_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE subscriptions DROP FOREIGN KEY FK_4778A017E3C61F9');
$this->addSql('DROP INDEX IDX_4778A017E3C61F9 ON subscriptions');
$this->addSql('ALTER TABLE subscriptions CHANGE owner_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE subscriptions ADD CONSTRAINT FK_4778A01A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)');
$this->addSql('CREATE INDEX IDX_4778A01A76ED395 ON subscriptions (user_id)');
$this->addSql('ALTER TABLE users DROP FOREIGN KEY FK_1483A5E9CF9564CB');
$this->addSql('ALTER TABLE users ADD CONSTRAINT FK_1483A5E9CF9564CB FOREIGN KEY (billing_subscription_id) REFERENCES subscriptions (id)');
}
}
@@ -0,0 +1,46 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170816121934 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 notifications DROP FOREIGN KEY FK_6000B0D37E3C61F9');
$this->addSql('ALTER TABLE notifications ADD CONSTRAINT FK_6000B0D37E3C61F9 FOREIGN KEY (owner_id) REFERENCES users (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE subscriptions DROP FOREIGN KEY FK_4778A017E3C61F9');
$this->addSql('ALTER TABLE subscriptions ADD CONSTRAINT FK_4778A017E3C61F9 FOREIGN KEY (owner_id) REFERENCES users (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE users DROP FOREIGN KEY FK_1483A5E9E92F8F78');
$this->addSql('ALTER TABLE users DROP number_of_subscribers, DROP number_of_saved_fields_allowed, DROP number_of_newsletters_allowed, DROP number_of_searches_per_day_allowed, DROP allow_to_create_saved_feeds');
$this->addSql('ALTER TABLE users ADD CONSTRAINT FK_1483A5E9E92F8F78 FOREIGN KEY (recipient_id) REFERENCES recipients (id) ON DELETE SET NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 notifications DROP FOREIGN KEY FK_6000B0D37E3C61F9');
$this->addSql('ALTER TABLE notifications ADD CONSTRAINT FK_6000B0D37E3C61F9 FOREIGN KEY (owner_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE subscriptions DROP FOREIGN KEY FK_4778A017E3C61F9');
$this->addSql('ALTER TABLE subscriptions ADD CONSTRAINT FK_4778A017E3C61F9 FOREIGN KEY (owner_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE users DROP FOREIGN KEY FK_1483A5E9E92F8F78');
$this->addSql('ALTER TABLE users ADD number_of_subscribers INT NOT NULL, ADD number_of_saved_fields_allowed INT NOT NULL, ADD number_of_newsletters_allowed INT NOT NULL, ADD number_of_searches_per_day_allowed INT NOT NULL, ADD allow_to_create_saved_feeds TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE users ADD CONSTRAINT FK_1483A5E9E92F8F78 FOREIGN KEY (recipient_id) REFERENCES recipients (id)');
}
}
@@ -0,0 +1,46 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170830113930 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE billing_subscription_agreement (id INT AUTO_INCREMENT NOT NULL, subscription_id INT DEFAULT NULL, agreement_id VARCHAR(255) NOT NULL, INDEX IDX_9BD6D8479A1887DC (subscription_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE billing_subscription_agreement ADD CONSTRAINT FK_9BD6D8479A1887DC FOREIGN KEY (subscription_id) REFERENCES subscriptions (id)');
$this->addSql('DROP TABLE payment_tokens');
$this->addSql('ALTER TABLE subscriptions ADD payed TINYINT(1) NOT NULL');
$this->addSql('UPDATE subscriptions SET payed = false');
$this->addSql('ALTER TABLE payments ADD gateway VARCHAR(255) NOT NULL COMMENT \'(DC2Type:payment_gateway)\', ADD created_at DATETIME NOT NULL, ADD success TINYINT(1) NOT NULL, ADD amount_amount NUMERIC(10, 2) NOT NULL, ADD amount_currency VARCHAR(4) NOT NULL, DROP number, DROP description, DROP client_email, DROP client_id, DROP currency_code, DROP details, CHANGE total_amount subscription_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE payments ADD CONSTRAINT FK_65D29B329A1887DC FOREIGN KEY (subscription_id) REFERENCES subscriptions (id)');
$this->addSql('CREATE INDEX IDX_65D29B329A1887DC ON payments (subscription_id)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('CREATE TABLE payment_tokens (hash VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, details LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci COMMENT \'(DC2Type:object)\', after_url LONGTEXT DEFAULT NULL COLLATE utf8_unicode_ci, target_url LONGTEXT NOT NULL COLLATE utf8_unicode_ci, gateway_name VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci, PRIMARY KEY(hash)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('DROP TABLE billing_subscription_agreement');
$this->addSql('ALTER TABLE payments DROP FOREIGN KEY FK_65D29B329A1887DC');
$this->addSql('DROP INDEX IDX_65D29B329A1887DC ON payments');
$this->addSql('ALTER TABLE payments ADD number VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD description VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD client_email VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD client_id VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD currency_code VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci, ADD details LONGTEXT NOT NULL COLLATE utf8_unicode_ci COMMENT \'(DC2Type:json_array)\', DROP gateway, DROP created_at, DROP success, DROP amount_amount, DROP amount_currency, CHANGE subscription_id total_amount INT DEFAULT NULL');
$this->addSql('ALTER TABLE subscriptions DROP payed');
}
}
@@ -0,0 +1,38 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170904125133 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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 subscriptions ADD gateway VARCHAR(255) NOT NULL COMMENT \'(DC2Type:payment_gateway)\'');
$this->addSql('ALTER TABLE billing_subscription_agreement ADD gateway VARCHAR(255) NOT NULL COMMENT \'(DC2Type:payment_gateway)\'');
$this->addSql('ALTER TABLE payments ADD transaction_id VARCHAR(255) NOT NULL, ADD status VARCHAR(255) NOT NULL COMMENT \'(DC2Type:payment_status)\', DROP success');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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 billing_subscription_agreement DROP gateway');
$this->addSql('ALTER TABLE payments ADD success TINYINT(1) NOT NULL, DROP transaction_id, DROP status');
$this->addSql('ALTER TABLE subscriptions DROP gateway');
}
}
@@ -0,0 +1,36 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170905141456 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
// this up() 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('CREATE TABLE deleted_documents (abstract_feed_id INT NOT NULL, document_sequence BIGINT NOT NULL, INDEX IDX_A3B88FFDF312DA93 (abstract_feed_id), INDEX IDX_A3B88FFDDD472672 (document_sequence), PRIMARY KEY(abstract_feed_id, document_sequence)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE deleted_documents ADD CONSTRAINT FK_A3B88FFDF312DA93 FOREIGN KEY (abstract_feed_id) REFERENCES feeds (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE deleted_documents ADD CONSTRAINT FK_A3B88FFDDD472672 FOREIGN KEY (document_sequence) REFERENCES documents (sequence)');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
// 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('DROP TABLE deleted_documents');
}
}

Some files were not shown because too many files have changed in this diff Show More