castopod/app/Database/Migrations/2020-05-30-101000_add_languages.php
Yassine Doghri a1a28de702 refactor: rewrite form pages using form helper
- add installGateway to app config
- update route names and groups
- remove `author_name` and `author_email` from `episodes` table
- remove `author_name` and `author_email` from `podcasts` table
- remove `owner_id` + add `created_by` and `updated_by` fields in `podcasts` and `episodes` tables
- remove unnecessary comments in database fields
- remove confirm password inputs from auth forms for better ux
- rename `pub_date` field to `published_at` and add publication time field in episode form

closes #14, #28
2020-10-15 14:41:32 +00:00

45 lines
1.0 KiB
PHP

<?php
/**
* Class AddLanguages
* Creates languages table in database
*
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AddLanguages extends Migration
{
public function up()
{
$this->forge->addField([
'code' => [
'type' => 'VARCHAR',
'comment' => 'ISO 639-1 language code.',
'constraint' => 2,
],
'name' => [
'type' => 'VARCHAR',
'comment' => 'English language name.',
'constraint' => 191,
],
'native_name' => [
'type' => 'VARCHAR',
'constraint' => 191,
],
]);
$this->forge->addKey('code', true);
$this->forge->createTable('languages');
}
public function down()
{
$this->forge->dropTable('languages');
}
}