diff --git a/.travis.yml b/.travis.yml index edd75a0..bc6dacc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ php: - 7.1 addons: - mariadb: '10.3' + mariadb: '10.2' before_script: - mysql -e 'CREATE DATABASE test;' @@ -15,9 +15,14 @@ before_script: script: - php bin/console doctrine:database:drop -n --force - php bin/console doctrine:database:create -n - - php bin/console doctrine:migrations:migrate -n + - php bin/console doctrine:schema:create -n - php bin/console doctrine:schema:update --dump-sql - php bin/console doctrine:schema:validate -n + - rm src/Entity/Admin.php + - mv AdminEdited.php src/Entity/Admin.php + - php bin/console doctrine:migrations:diff -n + - php bin/console doctrine:migrations:migrate -n + - php bin/console doctrine:schema:validate -n cache: directories: @@ -25,4 +30,4 @@ cache: notifications: email: - - bukashk0zzz@gmail.com \ No newline at end of file + - bukashk0zzz@gmail.com diff --git a/AdminEdited.php b/AdminEdited.php new file mode 100644 index 0000000..c84be4b --- /dev/null +++ b/AdminEdited.php @@ -0,0 +1,133 @@ +id; + } + + /** + * Set login + * + * @param string $login + * + * @return Admin + */ + public function setLogin(string $login): Admin + { + $this->login = $login; + + return $this; + } + + /** + * Get login + * + * @return string + */ + public function getLogin(): string + { + return $this->login; + } + + /** + * Set password + * + * @param string $password + * + * @return Admin + */ + public function setPassword(string $password): Admin + { + $this->password = $password; + + return $this; + } + + /** + * Get password + * + * @return string + */ + public function getPassword(): string + { + return $this->password; + } + + /** + * Set status + * + * @param bool $status + * + * @return Admin + */ + public function setStatus(bool $status): Admin + { + $this->status = $status; + + return $this; + } + + /** + * Get status + * + * @return bool + */ + public function getStatus(): bool + { + return $this->status; + } +} diff --git a/src/Migrations/Version20171204125843.php b/src/Migrations/Version20171204125843.php deleted file mode 100644 index 532d7e6..0000000 --- a/src/Migrations/Version20171204125843.php +++ /dev/null @@ -1,28 +0,0 @@ -abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); - - $this->addSql('CREATE TABLE admins (id INT UNSIGNED AUTO_INCREMENT NOT NULL, login VARCHAR(255) DEFAULT NULL, password VARCHAR(255) DEFAULT NULL, status TINYINT(1) DEFAULT \'1\' NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); - } - - 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 admins'); - } -}