source: trunk/grails-app/conf/DataSource.groovy @ 93

Last change on this file since 93 was 93, checked in by duh, 14 years ago
  • made development datasource system dependent (so Adem can use his PostgreSQL database
  • Property svn:keywords set to Date Author Rev
File size: 1.9 KB
Line 
1dataSource {
2        pooled = true
3        driverClassName = "org.hsqldb.jdbcDriver"
4        username = "sa"
5        password = ""
6}
7hibernate {
8        cache.use_second_level_cache = true
9        cache.use_query_cache = true
10        cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
11}
12// environment specific settings
13environments {
14        development {
15                dataSource {
16                        println "DATASOURCE DEBUG :: user.home = "+System.properties["user.home"]
17                        switch (System.properties["user.home"]) {
18                                case "/Users/adem":
19                                        // Adem like to use his own postgres database
20                                        dbCreate = "update"
21                                        username = "gscf"
22                                        password = "dbnp"
23
24                                        // PostgreSQL
25                                        driverClassName = "org.postgresql.Driver"
26                                        url = "jdbc:postgresql://localhost:5432/gscf"
27                                        dialect = org.hibernate.dialect.PostgreSQLDialect
28                                        break;
29                                default:
30                                        // by default we use an in memory development database
31                                        dbCreate = "create-drop" // one of 'create', 'create-drop','update'
32                                        url = "jdbc:hsqldb:mem:devDB"
33                                        break;
34                        }
35                }
36        }
37        test {
38                dataSource {
39                        dbCreate = "update"
40                        url = "jdbc:hsqldb:mem:testDb"
41                }
42        }
43        production {
44                dataSource {
45                        /*
46                         * when releasing a new stable to the live environment
47                         * you would probably comment out the dbCreate option
48                         * so hibernate won't try to update (which is does not
49                         * do so well) and you update the live database yourself
50                         *
51                         * @see http://grails.org/plugin/autobase
52                         * @see http://wiki.github.com/RobertFischer/autobase/example-usage
53                         */
54                        dbCreate = "update"
55                        username = "gscf"
56                        password = "dbnp"
57
58                        // PostgreSQL
59                        driverClassName = "org.postgresql.Driver"
60                        url = "jdbc:postgresql://localhost:5432/gscf"
61                        dialect = org.hibernate.dialect.PostgreSQLDialect
62
63                        // MySQL
64                        //driverClassName = "com.mysql.jdbc.Driver"
65                        //url = "jdbc:mysql://localhost/gscf"
66                        //dialect = "org.hibernate.dialect.MySQL5InnoDBDialect"
67
68                        //In memory
69                        //url = "jdbc:hsqldb:file:prodDb;shutdown=true"
70                }
71        }
72}
Note: See TracBrowser for help on using the repository browser.