ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ShortlinksDBSteps11.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27{
28 private \ilDBInterface $db;
29
30 public function prepare(\ilDBInterface $db): void
31 {
32 $this->db = $db;
33 }
34
35 public function step_1(): void
36 {
37 $fields = [
38 'id' => [
39 'type' => 'text',
40 'length' => 32,
41 'notnull' => true,
42 ],
43 'alias' => [
44 'type' => 'text',
45 'length' => 255,
46 'notnull' => true
47 ],
48 'target_type' => [
49 'type' => 'text',
50 'length' => 8,
51 'notnull' => true
52 ],
53 'target_type_data' => [
54 'type' => 'clob',
55 'notnull' => false,
56 ],
57 'position' => [
58 'type' => 'integer',
59 'notnull' => true,
60 ],
61 'active' => [
62 'type' => 'integer',
63 'length' => 1,
64 'notnull' => true,
65 'default' => 1,
66 ],
67 'used' => [
68 'type' => 'integer',
69 'notnull' => true,
70 'default' => 0,
71 ],
72 ];
73
74 $this->db->createTable('il_shortlinks', $fields);
75
76 $this->db->addPrimaryKey(
77 'il_shortlinks',
78 ['id']
79 );
80
81 $this->db->addIndex(
82 'il_shortlinks',
83 ['alias'],
84 'i1'
85 );
86 }
87
88}
return true
Interface ilDBInterface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...