Permalink
Browse files

update doc

  • Loading branch information...
1 parent 58bc2bb commit 831f4089a9e8a45fc2d37843be0dabb8fa955a44 @tianhsky committed Apr 7, 2012
Showing with 27 additions and 19 deletions.
  1. +20 −0 LICENSE
  2. +7 −19 README.md
View
@@ -0,0 +1,20 @@
+Copyright (c) 2012 Tianyu Huang
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -1,29 +1,17 @@
# EZModel
-Generate models and schema.rb from existing database just in one command line.
-If you prefer design ER diagram and export scripts to generate database schema,
-or if you have to work with a legacy database, this can save you insame amount of time.
-All you need to do is to have a database.yml configuraiton file in ~/config/.
-Besides creating all models it sets proper table name and primary key if tables
-and columns naming doesn’t follow Rails convention. It also tries to read all foreign
-keys data from a database.
+Generate models and schema.rb from existing database just in one command line. If you prefer design ER diagram and export scripts to generate database schema, or if you have to work with a legacy database, this can save you insame amount of time. All you need to do is to have a database.yml configuraiton file in ~/config/. Besides creating all models it sets proper table name and primary key if tables and columns naming doesn’t follow Rails convention. It also tries to read all foreign keys data from a database.
-It uses [Rmre](https://github.com/bosko/rmre "Rmre") as underlying reverse engine
-to generate models. I made some modifications to Rmre to support mysql2 adapter, and
-had those auto-generated model files placed in a subfolder inside ~/app/models/ez_models/
-instead of the default ~/app/models/, so that regenerating models will not overwrite
-the existing ones. Over the times, db schema can ge changed, all it needs is to run the
-command again to regenerate models, developers can feel free to add methods to the models
-classes in ~/app/models/ without worrying about being overwritten.
+It uses [Rmre](https://github.com/bosko/rmre "Rmre") as underlying reverse engine to generate models. I made some modifications to Rmre to support mysql2 adapter, and had those auto-generated model files placed in a subfolder inside ~/app/models/ez_models/ instead of the default ~/app/models/, so that regenerating models will not overwrite the existing ones. Over the times, db schema can ge changed, all it needs is to run the command again to regenerate models, developers can feel free to add methods to the models classes in ~/app/models/ without worrying about being overwritten.
## How to use it
###Prerequisite
-1. Setup database server, mysql is suggested;
+####1. Setup database server, mysql is suggested;
-2. Setup database schema, if you already have a database set up, skip this step;
- - there are many tools can be use for database design, you can then export scripts to generate db schema;
- - checkout mysql-workbench and its forward-engineering feature for more details about designing ER diagram and generate schema;
+####2. Setup database schema, if you already have a database set up, skip this step;
+ - there are many tools can be use for database design, you can then export scripts to generate db schema;
+ - checkout mysql-workbench and its forward-engineering feature for more details about designing ER diagram and generate schema;
-3. Prepare ~/config/database.yml, here is a sample:
+####3. Prepare ~/config/database.yml, here is a sample:
development:
adapter: mysql2

0 comments on commit 831f408

Please sign in to comment.