This repository has been archived on 2023-07-28. You can view files and clone it, but cannot push or open issues or pull requests.
prosody_web_admin_rest/data/migrations/20160710014947_UsersAwaitingVerificationTable.php

41 lines
849 B
PHP
Raw Normal View History

2021-05-20 23:21:43 +00:00
<?php
2016-07-10 15:32:38 +00:00
use Phpmig\Migration\Migration;
class UsersAwaitingVerificationTable extends Migration
{
public $tableName = 'users_awaiting_verification'; // Table name
public $db;
/**
2021-05-20 23:21:43 +00:00
* Do the migration
*/
2016-07-10 15:32:38 +00:00
public function up()
{
2021-05-20 23:21:43 +00:00
$this->db->create($this->tableName, function ($table) {
2016-07-10 15:32:38 +00:00
$table->increments('id');
$table->string('username');
$table->string('email')->unique();
$table->string('password');
$table->string('verification_code');
$table->timestamps();
});
}
/**
2021-05-20 23:21:43 +00:00
* Undo the migration
*/
2016-07-10 15:32:38 +00:00
public function down()
{
$this->db->dropIfExists($this->tableName);
}
/**
2021-05-20 23:21:43 +00:00
* Init the migration
*/
2016-07-10 15:32:38 +00:00
public function init()
{
$this->db = $this->container['schema'];
}
2021-05-20 23:21:43 +00:00
}