0

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.

2
  • The problem doesn't seem to be related to pgAdmin at all. Commented May 5, 2012 at 15:35
  • Yeah!!!, I mention pgadmin to inform you about the environment I'm working on.But anyway I've removed pgadmin mentions. Commented May 5, 2012 at 15:58

1 Answer 1

1

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?

1
  • 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 Commented May 5, 2012 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.