Quantcast

Table not created

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Table not created

rsom@certifydatasystems.com
Hi,

I'm building a fairly complex database schema in my grails app. One of the tables is not created on any database when deployed on tomcat. When I run schema-export, I don't see that table either.
However when I run the app using run-app, that table is created in the H2 database.

I would like to debug this. Can I enable some sort of logging that explains why that table is skipped by schema-export, but run-app creates it?

dev is set to create-drop. prod is set to update.

R,
rahul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Table not created

gauravchauhan
Did you try turning the hibernate/SQL logging on ? 

On Thu, Feb 2, 2012 at 12:13 AM, Rahul Somasunderam <[hidden email]> wrote:
Hi,

I'm building a fairly complex database schema in my grails app. One of the tables is not created on any database when deployed on tomcat. When I run schema-export, I don't see that table either.
However when I run the app using run-app, that table is created in the H2 database.

I would like to debug this. Can I enable some sort of logging that explains why that table is skipped by schema-export, but run-app creates it?

dev is set to create-drop. prod is set to update.

R,
rahul



--
Regards
Gaurav Chauhan
Contact No : +91-95607-66664 
Skype : chauhan.gaurav

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Table not created

burtbeckwith
SQL logging is only for runtime queries, it doesn't show the ddl statements.

Is there something weird about the table name or a field, e.g. a reserved word?

Are you're seeing a difference between the database created with run-app and with schema-export? That's unusual since all run-app does is delegate to Hibernate to create the tables - schema-export just calls the Hibernate SchemaExport class. You can pass the environment when running schema-export (like any script) - does the table show up if you run 'grails prod schema-export'?

Burt

On Thursday, February 02, 2012 12:21:15 AM Gaurav Chauhan wrote:

> Did you try turning the hibernate/SQL logging on ?
>
> On Thu, Feb 2, 2012 at 12:13 AM, Rahul Somasunderam <
> [hidden email]> wrote:
>
> > Hi,
> >
> > I'm building a fairly complex database schema in my grails app. One of the
> > tables is not created on any database when deployed on tomcat. When I run
> > *schema-export*, I don't see that table either.
> > However when I run the app using *run-app*, that table is created in the
> > H2 database.
> >
> > I would like to debug this. Can I enable some sort of logging that
> > explains why that table is skipped by *schema-export*, but *run-app*creates it?
> >
> > dev is set to *create-drop*. prod is set to *update*.
> >
> > R,
> > rahul


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Table not created

gauravchauhan
My mistake. I had some stuff in BootStrap.groovy which was doing db inserts and updates and i confused that with schema generation.

Thanks for pointing it out. 

On Thu, Feb 2, 2012 at 12:53 AM, Burt Beckwith <[hidden email]> wrote:
SQL logging is only for runtime queries, it doesn't show the ddl statements.

Is there something weird about the table name or a field, e.g. a reserved word?

Are you're seeing a difference between the database created with run-app and with schema-export? That's unusual since all run-app does is delegate to Hibernate to create the tables - schema-export just calls the Hibernate SchemaExport class. You can pass the environment when running schema-export (like any script) - does the table show up if you run 'grails prod schema-export'?

Burt

On Thursday, February 02, 2012 12:21:15 AM Gaurav Chauhan wrote:
> Did you try turning the hibernate/SQL logging on ?
>
> On Thu, Feb 2, 2012 at 12:13 AM, Rahul Somasunderam <
> [hidden email]> wrote:
>
> > Hi,
> >
> > I'm building a fairly complex database schema in my grails app. One of the
> > tables is not created on any database when deployed on tomcat. When I run
> > *schema-export*, I don't see that table either.
> > However when I run the app using *run-app*, that table is created in the
> > H2 database.
> >
> > I would like to debug this. Can I enable some sort of logging that
> > explains why that table is skipped by *schema-export*, but *run-app*creates it?
> >
> > dev is set to *create-drop*. prod is set to *update*.
> >
> > R,
> > rahul


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
Regards
Gaurav Chauhan
Contact No : +91-95607-66664 
Skype : chauhan.gaurav

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Table not created

rsom@certifydatasystems.com
My bad. I was using inheritance, and didn't expect the default behavior to be single table.
My QA was trying to load up data through the database. 
Educated him on using the console plugin and educated myself on reading the gorm docs.

R,
rahul

On Feb 1, 2012, at 11:45 AM, Gaurav Chauhan wrote:

My mistake. I had some stuff in BootStrap.groovy which was doing db inserts and updates and i confused that with schema generation.

Thanks for pointing it out. 

On Thu, Feb 2, 2012 at 12:53 AM, Burt Beckwith <[hidden email]> wrote:
SQL logging is only for runtime queries, it doesn't show the ddl statements.

Is there something weird about the table name or a field, e.g. a reserved word?

Are you're seeing a difference between the database created with run-app and with schema-export? That's unusual since all run-app does is delegate to Hibernate to create the tables - schema-export just calls the Hibernate SchemaExport class. You can pass the environment when running schema-export (like any script) - does the table show up if you run 'grails prod schema-export'?

Burt

On Thursday, February 02, 2012 12:21:15 AM Gaurav Chauhan wrote:
> Did you try turning the hibernate/SQL logging on ?
>
> On Thu, Feb 2, 2012 at 12:13 AM, Rahul Somasunderam <
> [hidden email]> wrote:
>
> > Hi,
> >
> > I'm building a fairly complex database schema in my grails app. One of the
> > tables is not created on any database when deployed on tomcat. When I run
> > *schema-export*, I don't see that table either.
> > However when I run the app using *run-app*, that table is created in the
> > H2 database.
> >
> > I would like to debug this. Can I enable some sort of logging that
> > explains why that table is skipped by *schema-export*, but *run-app*creates it?
> >
> > dev is set to *create-drop*. prod is set to *update*.
> >
> > R,
> > rahul


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
Regards
Gaurav Chauhan
Contact No : +91-95607-66664 
Skype : chauhan.gaurav


Loading...