Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 14 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| SmoothRdsModel | |
0.00% |
0 / 14 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| addSmoothTables | |
0.00% |
0 / 14 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2018 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | namespace oat\generis\model\kernel\persistence\smoothsql\install; |
| 23 | |
| 24 | use Doctrine\DBAL\Schema\Schema; |
| 25 | |
| 26 | /** |
| 27 | * Helper to setup the required tables for generis smoothsql |
| 28 | */ |
| 29 | class SmoothRdsModel |
| 30 | { |
| 31 | /** |
| 32 | * |
| 33 | * @param Schema $schema |
| 34 | * @return \Doctrine\DBAL\Schema\Schema |
| 35 | */ |
| 36 | public static function addSmoothTables(Schema $schema) |
| 37 | { |
| 38 | $table = $schema->createTable("statements"); |
| 39 | $table->addColumn("modelid", "integer", ["notnull" => true,"default" => 0]); |
| 40 | $table->addColumn("subject", "string", ["length" => 255,"default" => null]); |
| 41 | $table->addColumn("predicate", "string", ["length" => 255,"default" => null]); |
| 42 | $table->addColumn("object", "text", ["default" => null,"notnull" => false]); |
| 43 | |
| 44 | $table->addColumn("l_language", "string", ["length" => 255,"default" => null,"notnull" => false]); |
| 45 | $table->addColumn("id", "integer", ["notnull" => true,"autoincrement" => true]); |
| 46 | $table->addColumn("author", "string", ["length" => 255,"default" => null,"notnull" => false]); |
| 47 | $table->setPrimaryKey(["id"]); |
| 48 | $table->addOption('engine', 'MyISAM'); |
| 49 | $table->addColumn("epoch", "string", ["notnull" => null]); |
| 50 | |
| 51 | $table->addIndex(["subject","predicate"], "k_sp", [], ['lengths' => [164,164]]); |
| 52 | $table->addIndex(["predicate","object"], "k_po", [], ['lengths' => [164,164]]); |
| 53 | return $schema; |
| 54 | } |
| 55 | } |