Dokifansubs / anidex_www

Front end for anidex.moe
0 stars 0 forks source link

Intergroup project collaborations #51

Open KamiyamaKiriko opened 9 years ago

KamiyamaKiriko commented 9 years ago
&KamiyamaKiriko | Hm, now that I think about it
              > | How would you guys handle collab projects?
      &Orillion | THERE SHALL BE NO INTERMINGLING
              > | Good idea
              > | Create an issue
              > | "Plz2handle collabs"
Fyurie commented 9 years ago

A summarisation of the earlier IRC discussion relating to how this could be implemented would probably be a good idea.

KamiyamaKiriko commented 9 years ago

Hopefully a log will do.

https://gist.github.com/KamiyamaKiriko/a912d1709faf8672686f

Orillion360 commented 9 years ago

Create pseudo groups? Groups can set up a pseudo group with at least 1 other group.

Create table with torrent_id, group_id, pseudo_group_id, and user_id

martirsadota commented 9 years ago

Pseudogroups seems like a good idea.

DeathHere commented 9 years ago

Or you could just do a Many-to-Many group to torrent relationships (Can even let you do 3 groups at a time.):

e.g.: (I just copied this out of my django-autogen queries. change the types as need be. I also have a similar thing done for users to groups.) Table for groups: CREATE TABLE index_group ( id integer AUTO_INCREMENT NOT NULL PRIMARY KEY, name varchar(200) NOT NULL, website varchar(200) NOT NULL )

Tables for torrents: CREATE TABLE index_torrent ( id integer AUTO_INCREMENT NOT NULL PRIMARY KEY, name varchar(200) NOT NULL, owner_id integer NOT NULL, likes integer NOT NULL, size integer NOT NULL, info_hash varchar(40) NOT NULL, date datetime NOT NULL )

Many to Many relationships table CREATE TABLE index_torrent_groups ( id integer AUTO_INCREMENT NOT NULL PRIMARY KEY, torrent_id integer NOT NULL, group_id integer NOT NULL, UNIQUE (torrent_id, group_id) )

Foreign key link for easier and faster joining:

ALTER TABLE index_torrent_groups ADD CONSTRAINT group_id_refs_id_63c48fc4 FOREIGN KEY (group_id) REFERENCES index_group (id); ALTER TABLE index_torrent_groups ADD CONSTRAINT torrent_id_refs_id_6981c024 FOREIGN KEY (torrent_id) REFERENCES index_torrent (id);

Orillion360 commented 9 years ago

That was the plan! Hence the "at least 1" What I suggested:

CREATE TABLE index_torrent_groups ( id integer AUTO_INCREMENT NOT NULL PRIMARY KEY, torrent_id integer NOT NULL, group_id integer NOT NULL, pseudo_group_id integer, UNIQUE (torrent_id, group_id, pseudo_group_id) )

Orillion360 commented 9 years ago

Will just create many-to-many relation between torrent and group. People can search for collaborations with the AND in search query.

Orillion360 commented 9 years ago

Modified DB to support this.