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

Last change on this file since 278 was 278, checked in by duh, 14 years ago
  • fixed study wizard saving
  • Property svn:keywords set to Author Rev Date
File size: 2.1 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/TURNEDOFFBYDEFAULT":
19                                        // Development Postgres Database is turned off by default
20                                        // if you do want to keep your data you can:
21                                        //      - reformate 'case' to your user.home (/Users/adem ?)
22                                        //      - define development data in the BootStrap.groovy instead
23                                        dbCreate = "update"
24                                        username = "gscf"
25                                        password = "dbnp"
26
27                                        // PostgreSQL
28                                        driverClassName = "org.postgresql.Driver"
29                                        url = "jdbc:postgresql://localhost:5432/gscf"
30                                        dialect = org.hibernate.dialect.PostgreSQLDialect
31                                        break;
32                                default:
33                                        // by default we use an in memory development database
34                                        dbCreate = "create-drop" // one of 'create', 'create-drop','update'
35                                        url = "jdbc:hsqldb:mem:devDB"
36                                        //loggingSql = true
37                                        break;
38                        }
39                }
40        }
41        test {
42                dataSource {
43                        dbCreate = "update"
44                        url = "jdbc:hsqldb:mem:testDb"
45                }
46        }
47        production {
48                dataSource {
49                        /*
50                         * when releasing a new stable to the live environment
51                         * you would probably comment out the dbCreate option
52                         * so hibernate won't try to update (which is does not
53                         * do so well) and you update the live database yourself
54                         *
55                         * @see http://grails.org/plugin/autobase
56                         * @see http://wiki.github.com/RobertFischer/autobase/example-usage
57                         */
58                        dbCreate = "update"
59                        username = "gscf"
60                        password = "dbnp"
61
62                        // PostgreSQL
63                        driverClassName = "org.postgresql.Driver"
64                        url = "jdbc:postgresql://localhost:5432/gscf"
65                        dialect = org.hibernate.dialect.PostgreSQLDialect
66
67                        // MySQL
68                        //driverClassName = "com.mysql.jdbc.Driver"
69                        //url = "jdbc:mysql://localhost/gscf"
70                        //dialect = "org.hibernate.dialect.MySQL5InnoDBDialect"
71
72                        //In memory
73                        //url = "jdbc:hsqldb:file:prodDb;shutdown=true"
74                }
75        }
76}
Note: See TracBrowser for help on using the repository browser.