summaryrefslogtreecommitdiff
path: root/util/dump.sql
AgeCommit message (Collapse)AuthorFilesLines
2009-08-08Converted votes.date to timestamptz and use NOW() as defaultYorhel1-1/+1
2009-08-08Converted threads_posts.date and edited to timestamptzYorhel1-2/+2
Everything still seems to be working fine so far.
2009-08-08Converted wlists.added and rlists.added to timestamptzYorhel1-2/+2
I like how the rlists.added column isn't used anywhere in the code, makes the conversion a lot easier. :-)
2009-08-08Convert old category relations to tags and remove vn_categoriesYorhel1-9/+0
This will currently generate a 500 error for VN pages, because they still try to look something up in the vn_categories table. Will fix that soon. Obviously, this conversion script only works on the actual VNDB database, if you run your own VNDB you can safely ignore the INSERT error when executing update_2.6.sql.
2009-08-06Use timestamptz data type instead of timestampYorhel1-2/+2
It took me a while to figure out that the "timestamp with timezone" PostgreSQL type doesn't actually store the time zone, it simply stores and calculates on UTC, and only converts it to the connection time zone in the formatting stage before sending it to the SQL client. When working with date/times in PgSQL, the NOW() (and related) functions return a timestamp with time zone. Upon converting that to a timestamp without time zone type, the current timezone setting is used. Meaning that comparing a column of type timestamp without timezone to NOW() will only work if all data in the columns is stored in the same timezone as that of the current connection, which in turn means that changing this setting at any point will cause all data in timestamp without timezone columns to be incorrectly interpreted. I often praise PostgreSQL for their comprehensive documentation, but they could've pointed this out more clearly...
2009-08-05Multi::IRC: Reimplemented notifications using PgSQL LISTEN/NOTIFYYorhel1-0/+19
2009-07-31Use bytea data type to store session tokensYorhel1-1/+1
To be consistent with users.passwd - hashes are stored in binary. All conversion from/to hex is done in the DB layer.
2009-07-30Fixed syntax error in update_2.6.sql and removed leading spaces in dump.sqlYorhel1-2/+2
That syntax error was partly 3dB's fault, and partly my fault for changing too much in that merge, heh.
2009-07-30Merge branch 'auth' of git://3decibels.net/vndb into betaYorhel1-1/+11
Conflicts: util/dump.sql util/updates/update_2.6.sql Also updated ChangeLog and made some tiny style changes.
2009-07-29Changed sessions.expiration column to timestamp3dB1-2/+2
-- Updated SQL files to reflect column type change. -- Subroutine dbSessionAdd rewritten to accept an expiration timestap as an optional third argument.
2009-07-28Multiple bugfixes to authorization system & sql tweaks3dB1-1/+11
This commit is tested to work.
2009-07-23Implemented relgraph notify from PgSQL triggerYorhel1-0/+36
This finishes the new relation graph generator, as it'll now regenerate graphs as soon as is needed. This obsletes the VNDB::Util::Misc::vnCacheUpdate() function, this functionality is provided by triggers within PostgreSQL. The update_vncache(0) procedure is now significantly slower due to the trigger on the vn table. It'd be a good idea to rewrite this procedure by using triggers and conditional updates, to drastically lower the number of rows that need to be updated.
2009-07-19Removed DEFERRED property on most foreign key constraintsYorhel1-43/+41
Only allowing the deferred state on a select few foreign keys would detect problems in an earlier stage (rather than waiting for a commit to happen), and guarantees that some things are inserted before others, which in turn eases the writing of trigger functions.
2009-07-19Notify Multi::Image via PostgreSQL for new screenshotsYorhel1-0/+12
This finished the rewrite of Multi::Image and everything surrounding it.
2009-07-19Converted and renamed screenshots.status (int) to processed (bool)Yorhel1-1/+1
There were only two states, processed and unprocessed, so simply using a boolean column with correct naming is more clarifying.
2009-07-18Notify Multi::Image for new cover images via LISTEN/NOTIFYYorhel1-0/+13
Yay! Another weird shared-memory-command optimized away. And the image resizer reacts a lot faster now. Noticably, even.
2009-07-18Use PostgreSQL's LISTEN/NOTIFY to notify Multi::Anime for new animeYorhel1-0/+15
The notify is called from a trigger function, which is called on any UPDATE or INSERT INTO query of which the lastfetch column is NULL. This guarantees that anime info in the DB will always be updated, no matter how its inserted.
2009-07-18Automatically insert rows into anime table for new vn_anime.aid itemsYorhel1-0/+12
This is a lot less error-prone than doing it from Perl. <3 PostgreSQL
2009-07-18Modified definition of the anime tableYorhel1-7/+7
Removed most NOT NULL constraints, and converted lastfetch to a timestamp data type. The site has been updated to handle this, but Multi::Anime won't work.
2009-07-14Removed old and unused table/column definitions from dump.sqlYorhel1-11/+0
2009-07-08Keep track of users who requested tagsYorhel1-1/+3
2009-07-04Implemented support for multilingual releasesYorhel1-4/+12
The 'language' column in releases_rev has been replaced with a releases_lang table. As this is quite a big change, there may still be bugs floating around somewhere.
2009-05-23Animation fields for releasesYorhel1-1/+3
2009-05-23Added freeware and doujin information to releasesYorhel1-1/+3
TODO: - update d3 - filters on /r
2009-05-22Voiced field for releasesYorhel1-1/+2
TODO: filter on /r
2009-05-22Added resolution field to release entriesYorhel1-1/+2
TODO: - Update d3 - Add filter to /r
2009-05-09Don't consider VNs with AVG(vote) < 0 on tag pagesYorhel1-2/+2
The bayesian ranking algorithm isn't exactly meant to be used to differentiate between absolute values, so do a pre-check on AVG(vote) before considering a VN in the rating. I've also played around with using plain old averages as score, but I'd say the ordering is a lot better with the bayesian ranking, the displayed score is just slightly more confusing.
2009-03-28Fixed and re-organized tag<->vn calculationYorhel1-37/+33
Fixed major performance bug caused by referencing the wrong table, moved all intermediate views to tag_vn_calc() as temporary views (similar to update_vnpopularity()) and renamed tags_vn_stored to tags_vn_bayesian.
2009-03-22Fixed tiny SQL bugYorhel1-1/+1
2009-03-22Merge branch 'tagging' into betaYorhel1-5/+174
Conflicts: lib/VNDB/DB/Discussions.pm util/updates/update_2.3.sql
2009-03-22Incorporated update_2.3.sql into dump.sql and updated the dbgrapher scriptYorhel1-5/+174
2009-02-21Aliases field to producer entriesYorhel1-1/+2
2009-02-12Catalog number field to release entriesYorhel1-1/+2
2009-01-25Random quote featureYorhel1-0/+10
2009-01-10Limit account creation to one account a day per IPYorhel1-1/+2
This would at least annoy the people who'll try to manipulate the rankings, and will make finding duplicate users a bit easier. (Not that it's really a problem at the moment)
2009-01-10Added VN popularity rankingYorhel1-1/+14
The following query should be run periodically to update the rankings: SELECT update_vnpopularity(); I'll fix Multi::Maintenance to do this automatically.
2009-01-04Added patch flag to releasesYorhel1-2/+4
TODO: update d3 and automatically convert all 'patch' media releases in the DB to use this flag.
2008-12-23Fixed syntax error in dump.sqlYorhel1-2/+2
2008-12-23Added skin selector to profile pageYorhel1-0/+1
2008-12-112 Bugfixes with user registrationYorhel1-1/+1
2008-11-29Caching the global database statisticsYorhel1-6/+74
Because I can't say no to a performance increase of 4 to 7ms for -every- pageview! Makes use of postgresql triggers and stored procedures.
2008-11-11Removed users.flags and used two boolean columns insteadYorhel1-0/+2
I wasn't planning on really touching the database in the rewrite, but oh well, I've always wanted to do this, anyway.
2008-11-11Cached each users change and vote counts in the users tableYorhel1-1/+29
And added triggers to keep these up to date, and made it possible to sort on the change and vote count on the userlist
2008-10-18Added original title field to VN entriesyorhel1-0/+1
git-svn-id: svn://vndb.org/vndb@112 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
2008-08-27Added release link to screenshotsyorhel1-0/+2
git-svn-id: svn://vndb.org/vndb@103 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
2008-08-20Fixed error when creating a new thread, changed type of threads_posts.num to ↵yorhel1-1/+2
smallint, and added (yet another) foreign key constraint to the threads table git-svn-id: svn://vndb.org/vndb@100 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
2008-08-20Another internal database change: changes.causedby accepts NULL values and ↵yorhel1-1/+2
properly references changes.id git-svn-id: svn://vndb.org/vndb@99 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
2008-08-18Stored relgraph image maps in the DB, instead of using plain text files in ↵yorhel1-2/+8
/data/rg/ git-svn-id: svn://vndb.org/vndb@93 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
2008-08-15Converted smallints used as boolean to PostgreSQL's relatively new (8.1) ↵1.21yorhel1-14/+14
boolean type. git-svn-id: svn://vndb.org/vndb@90 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
2008-08-14Added screenshots table to store the dimensions of all images, moved to AJAX ↵yorhel1-3/+11
for determining when a thumbnail has been generated after uploading a screenshot, and got rid of the javascript image preloader git-svn-id: svn://vndb.org/vndb@84 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b