Opened 13 years ago
Closed 13 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: |
Description
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 , 13 years ago
| Keywords: | sprint added |
|---|
comment:2 by , 13 years ago
comment:3 by , 13 years ago
| Owner: | set to |
|---|---|
| Status: | new → accepted |
comment:4 by , 13 years ago
| Keywords: | review added |
|---|
pull request branch: issue643
https://gitorious.org/mediagoblin/mediagoblin/merge_requests/58
comment:5 by , 13 years ago
branch: issue643
link to repo: https://gitorious.org/~rodney757/mediagoblin/rodney757s-mediagoblin
comment:6 by , 13 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 , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
Okay, tested it! Things are working, merged to master, and pushed!

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