Opened 11 years ago

Closed 11 years ago

#643 closed defect (fixed)

Unique contraint for user+slug on collections

Reported by: Elrond Owned by: rodney757
Priority: major Milestone: 0.4.0
Component: programming Keywords: sql bitesized sprint review
Cc: Parent Tickets:


I think, there should be a unique constraint on (user, slug) on collections.

Rationale: We should not have two collections with the same slug for one user. And we most likely should tell the db about this.

Change History (7)

comment:1 by Elrond, 11 years ago

Keywords: sprint added

comment:2 by David Thompson, 11 years ago

The migration should also test for existing entries with the same slug and fix them. Elrond says: use generate_slug!

comment:3 by rodney757, 11 years ago

Owner: set to rodney757
Status: newaccepted

comment:4 by rodney757, 11 years ago

Keywords: review added

comment:6 by Christopher Allan Webber, 11 years ago

This looks good, though I have not tested it!

If we had larger instances I might be worried about the size of that existing_slugs dict, but as is, it seems fine.

I'll give this a test tomorrow hopefully then I think it should be merged.

comment:7 by Christopher Allan Webber, 11 years ago

Resolution: fixed
Status: acceptedclosed

Okay, tested it! Things are working, merged to master, and pushed!

Note: See TracTickets for help on using tickets.