Closed Bug 456126 Opened 17 years ago Closed 17 years ago

Set up database for collections

Categories

(addons.mozilla.org Graveyard :: Collections, defect, P1)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: fligtar, Assigned: rdoherty)

References

Details

Attachments

(1 file, 1 obsolete file)

From the specs: * The database tables and schema for supporting user-created collections needs to be created for use with the web service and website. We need to plan and implement the schema, figuring out what tables and columns are going to be needed.
Priority: -- → P1
Target Milestone: --- → 4.0.2
Assignee: nobody → morgamic
Blocks: 456129
Ryan - let's work on this together this week.
Assignee: morgamic → rdoherty
No longer blocks: 456129
Blocks: 456129
Blocks: 456130
From the mockups/wireframes it looks like we need: * Bandwagon categories table * id * description * Addon <-> Bandwagon categories table * addon_id * bandwagon_category_id Anything else?
* Date added to addon <-> categories table
Some of the other tables have created and modified, not sure if that is needed here -- Justin?
I think we'd only need the creation date for Addon <-> Bandwagon categories table. We do need a tables for the lists themselves, though: * Bandwagon lists table ** id ** name (l10n) ** description (l10n) ** access (open or closed) ** listed (boolean - whether listed in directory) ** password ** subscribers (int) ** created ** modified * Addon <-> Bandwagon lists table ** addon_id ** list_id ** created * Bandwagon lists <-> Users ** list_id ** user_id ** role * Bandwagon lists <-> tags/categories Lists can be in categories. We need to decide whether to make a special list categories table or make List an addontype_id and just use the normal categories table (would be easier).
Thanks Justin for the detailed list. Are there any possible drawbacks to making the lists an addontype_id? I'm not familiar enough with how that table is used to know if it will cause any problems.
Attached patch Patch for database structure (obsolete) — Splinter Review
Here's my first run at the table structures.
Attachment #340361 - Flags: review?(morgamic)
Comment on attachment 340361 [details] [diff] [review] Patch for database structure Looks okay to me, unless you want collection name to be unique, in which case you'd want to add it to the collections table primary key. You may also want an index on `listed` if it's going to be in retrieval queries but we can always optimize after we have our queries formed in the controllers.
Attachment #340361 - Flags: review?(morgamic) → review+
Added the index, forgot to put in foreign key constraints.
Attachment #340361 - Attachment is obsolete: true
Attachment #341336 - Flags: review?(morgamic)
Comment on attachment 341336 [details] [diff] [review] SQL with index and proper foreign key constraints wfm
Attachment #341336 - Flags: review?(morgamic) → review+
Status: NEW → RESOLVED
Closed: 17 years ago
Keywords: push-needed
Resolution: --- → FIXED
I added "drop table if exists" statements to your SQL in r18999. If there was a reason they were omitted let me know and I can back it out.
Summary: Setup database for collections → Set up database for collections
Collections are in and seem to be working fine; verified FIXED.
Status: RESOLVED → VERIFIED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: