1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/agendav_ynh.git synced 2024-09-03 20:36:12 +02:00
agendav_ynh/sources/web/application/migrations/001_share_write_access.php
2014-01-07 17:53:08 +01:00

22 lines
837 B
PHP

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Migration_Share_write_access extends CI_Migration {
public function up() {
echo "Adding column write_access to shared table...\n";
// DBForge PostgreSQL support is broken
// (https://github.com/EllisLab/CodeIgniter/issues/808)
// Can't use it to add a new column :-(
$this->db->query("ALTER TABLE shared ADD COLUMN write_access BOOLEAN
NOT NULL DEFAULT '0'");
// AgenDAV only provided write access prior to version 1.2.5
echo "Setting initial value for write_access...\n";
$q = $this->db->update('shared', array('write_access' => '1'));
}
public function down() {
$this->dbforge->drop_column('shared',
'write_access');
}
}