Total Complexity | 4 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | abstract class Migration extends Database_Migration { |
||
24 | |||
25 | /** |
||
26 | * Creates an instance of the migration. |
||
27 | */ |
||
28 | public function __construct() { |
||
29 | $this->table_name = $this->table_name(); |
||
30 | $this->schema = new Schema( $this->table_name, array( $this, 'schema' ) ); |
||
31 | $this->seed_data = $this->seed( array() ); |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * Must return the table name for the migration. |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | abstract protected function table_name(): string; |
||
40 | |||
41 | /** |
||
42 | * Is this table dropped on deactivation |
||
43 | * |
||
44 | * Defaults to false. |
||
45 | * |
||
46 | * @return bool |
||
47 | */ |
||
48 | public function drop_on_deactivation(): bool { |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * Drop table on uninstall. |
||
54 | * |
||
55 | * Defaults to false. |
||
56 | * |
||
57 | * @return bool |
||
58 | */ |
||
59 | public function drop_on_uninstall(): bool { |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * Should this migration be seeded on activation. |
||
65 | * |
||
66 | * Defaults to true. |
||
67 | * |
||
68 | * @return bool |
||
69 | */ |
||
70 | public function seed_on_inital_activation(): bool { |
||
74 |