1
|
|
|
<?php |
2
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed'); |
3
|
|
|
|
4
|
|
|
/* |
5
|
|
|
|-------------------------------------------------------------------------- |
6
|
|
|
| Enable/Disable Migrations |
7
|
|
|
|-------------------------------------------------------------------------- |
8
|
|
|
| |
9
|
|
|
| Migrations are disabled by default for security reasons. |
10
|
|
|
| You should enable migrations whenever you intend to do a schema migration |
11
|
|
|
| and disable it back when you're done. |
12
|
|
|
| |
13
|
|
|
*/ |
14
|
|
|
$config['migration_enabled'] = true; |
15
|
|
|
|
16
|
|
|
/* |
17
|
|
|
|-------------------------------------------------------------------------- |
18
|
|
|
| Migration Type |
19
|
|
|
|-------------------------------------------------------------------------- |
20
|
|
|
| |
21
|
|
|
| Migration file names may be based on a sequential identifier or on |
22
|
|
|
| a timestamp. Options are: |
23
|
|
|
| |
24
|
|
|
| 'sequential' = Sequential migration naming (001_add_blog.php) |
25
|
|
|
| 'timestamp' = Timestamp migration naming (20121031104401_add_blog.php) |
26
|
|
|
| Use timestamp format YYYYMMDDHHIISS. |
27
|
|
|
| |
28
|
|
|
| Note: If this configuration value is missing the Migration library |
29
|
|
|
| defaults to 'sequential' for backward compatibility with CI2. |
30
|
|
|
| |
31
|
|
|
*/ |
32
|
|
|
$config['migration_type'] = 'timestamp'; |
33
|
|
|
|
34
|
|
|
/* |
35
|
|
|
|-------------------------------------------------------------------------- |
36
|
|
|
| Migrations table |
37
|
|
|
|-------------------------------------------------------------------------- |
38
|
|
|
| |
39
|
|
|
| This is the name of the table that will store the current migrations state. |
40
|
|
|
| When migrations runs it will store in a database table which migration |
41
|
|
|
| level the system is at. It then compares the migration level in this |
42
|
|
|
| table to the $config['migration_version'] if they are not the same it |
43
|
|
|
| will migrate up. This must be set. |
44
|
|
|
| |
45
|
|
|
*/ |
46
|
|
|
$config['migration_table'] = 'migrations'; |
47
|
|
|
|
48
|
|
|
/* |
49
|
|
|
|-------------------------------------------------------------------------- |
50
|
|
|
| Auto Migrate To Latest |
51
|
|
|
|-------------------------------------------------------------------------- |
52
|
|
|
| |
53
|
|
|
| If this is set to TRUE when you load the migrations class and have |
54
|
|
|
| $config['migration_enabled'] set to TRUE the system will auto migrate |
55
|
|
|
| to your latest migration (whatever $config['migration_version'] is |
56
|
|
|
| set to). This way you do not have to call migrations anywhere else |
57
|
|
|
| in your code to have the latest migration. |
58
|
|
|
| |
59
|
|
|
*/ |
60
|
|
|
$config['migration_auto_latest'] = FALSE; |
61
|
|
|
|
62
|
|
|
/* |
63
|
|
|
|-------------------------------------------------------------------------- |
64
|
|
|
| Migrations version |
65
|
|
|
|-------------------------------------------------------------------------- |
66
|
|
|
| |
67
|
|
|
| This is used to set migration version that the file system should be on. |
68
|
|
|
| If you run $this->migration->current() this is the version that schema will |
69
|
|
|
| be upgraded / downgraded to. |
70
|
|
|
| |
71
|
|
|
*/ |
72
|
|
|
$config['migration_version'] = 0; |
73
|
|
|
|
74
|
|
|
/* |
75
|
|
|
|-------------------------------------------------------------------------- |
76
|
|
|
| Migrations Paths |
77
|
|
|
|-------------------------------------------------------------------------- |
78
|
|
|
| |
79
|
|
|
| Path to your migrations folders. |
80
|
|
|
| Typically, it will be within your application path. |
81
|
|
|
| Also, writing permission is required within the migrations path. |
82
|
|
|
| |
83
|
|
|
| The key is the alias that you will refer to when running migrations. |
84
|
|
|
*/ |
85
|
|
|
$config['migration_paths'] = array( |
86
|
|
|
'app' => APPPATH . 'database/migrations/' |
87
|
|
|
); |
88
|
|
|
|
89
|
|
|
|
90
|
|
|
/* |
91
|
|
|
|-------------------------------------------------------------------------- |
92
|
|
|
| Create Table Attribute |
93
|
|
|
|-------------------------------------------------------------------------- |
94
|
|
|
| |
95
|
|
|
| An array of data that will be passed to the dbforge create_table method |
96
|
|
|
| in migrations that are generated by Sprint for you. This allows you |
97
|
|
|
| to set any custom attributes, like ENGINE or CHARSET when the table |
98
|
|
|
| is created. |
99
|
|
|
| |
100
|
|
|
| Especially beneficial if your db setup needs InnoDB tables and is |
101
|
|
|
| not setup to provide that be default. |
102
|
|
|
*/ |
103
|
|
|
$config['migration_create_table_attr'] = [ |
104
|
|
|
// 'ENGINE' => 'InnoDB' |
|
|
|
|
105
|
|
|
]; |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.