1
+ h1. Codeignit*o*r-Migrations (with an o yo)
2
+
3
+ h2. Authors
4
+ Forked By:
5
+
6
+ http://www.webPragmatist.com/
7
+
1
8
By:
2
9
Spicer Matthews <
[email protected] >
3
10
Cloudmanic Labs, LLC
6
13
Based On:
7
14
http://codeigniter.com/wiki/Migrations/
8
15
By: Mat'as Montes
16
+
17
+ h3. Descriptions
9
18
10
- Description:
11
19
An open source utility for Codeigniter inspired by Ruby on Rails.
12
20
13
21
The one thing Ruby on Rails has that Codeigniter does not have built in
@@ -19,7 +27,8 @@ Description:
19
27
are powerful and work in nearly the same way. Maybe someday we can create a joint project
20
28
with Mat'as or even better get this into that core of Codeigniter.
21
29
22
- Install:
30
+ h4. Installation
31
+
23
32
Copy the files to these locations.
24
33
25
34
migrate.php -> application/libraries/
@@ -28,7 +37,8 @@ Install:
28
37
The migration files included in this are just examples. You should install them where ever you
29
38
point your $config["migrations_path"] to.
30
39
31
- Add these config to your config.php
40
+ Add these config to your -config.php- migration.php
41
+
32
42
33
43
/*
34
44
|--------------------------------------------------------------------------
@@ -85,10 +95,10 @@ Usage:
85
95
The dbmigreate.php controller just shows the use of these functions. If you are going to use it.
86
96
remove the 'die();' and put it back in place when you are done.
87
97
88
- ** THE KICKER **
98
+ - ** THE KICKER **
89
99
At the bottom of migreate.php we assume you are keeping track of your versions with a db table called config. Yes
90
100
you can not use this migration script to create that table. You need at least one table installed to boot strap this.
91
- You will want to review the _update_schema_version() function to either modify or copy how it works.
101
+ You will want to review the _update_schema_version() function to either modify or copy how it works.
92
102
93
103
Also, in our applcations we have this code to set our applcation configs. We do not believe in writting to the file system
94
104
that is what a database is for :).
@@ -104,7 +114,9 @@ Usage:
104
114
}
105
115
106
116
In this code we set. $this->CI->config->item('migrationversion'); and that is how _get_schema_version()
107
- gets the current version. This is the version this database is set too.
117
+ gets the current version. This is the version this database is set too.-
118
+
119
+ All the above stuff is bullocks in this fork. This guy creates a schema_version table for you an stuffs 0 in it to begin with.
108
120
109
121
** Suggestion **
110
122
We also do this on login to make sure this database is migrated to the version the config files wants it to be migrated too.
@@ -127,5 +139,4 @@ When you auto load the system.php lib this should be your order: $autoload['libr
127
139
128
140
Here is a video walk through of migrations in action.
129
141
130
- http://www.vimeo.com/13490644
131
-
142
+ http://www.vimeo.com/13490644
0 commit comments