Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

strong textActually I'm using pgAdmin to manage PostgreSQL development database in a rails application.

I've defined the following constraints on USERS table:

 CONSTRAINT users_pkey PRIMARY KEY (id ),
 CONSTRAINT users_name_key UNIQUE (name ),
 CONSTRAINT users_age_check CHECK (age > 16),

But when I do rake:db:test:clone the test database copy the development structure except the above constraints.

share|improve this question
The problem doesn't seem to be related to pgAdmin at all. – Erwin Brandstetter May 5 '12 at 15:35
Yeah!!!, I mention pgadmin to inform you about the environment I'm working on.But anyway I've removed pgadmin mentions. – blawzoo May 5 '12 at 15:58

1 Answer

up vote 1 down vote accepted

Is it really necessary to clone your DB with Ruby? Isn't it easier to create your clone from within Postgres using create Db with template?

share|improve this answer
Thanks vergage, that's a good point.I've tried recreate test db from development db template, but the problem when I run 'rake test' the command purge the test database & recreate a new one without the constraints – blawzoo May 5 '12 at 16:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.