mirror of
https://github.com/alanorth/cgspace-notes.git
synced 2025-01-27 05:49:12 +01:00
Update notes for 2018-09-24
This commit is contained in:
@ -459,5 +459,14 @@ Type "help", "copyright", "credits" or "license" for more information.
|
||||
|
||||
- Or maybe I should just bite the bullet and migrate this to PostgreSQL, as it [supports `UPSERT` since version 9.5](https://wiki.postgresql.org/wiki/UPSERT) and also seems to have my new favorite `LIMIT` and `OFFSET`
|
||||
- I changed the syntax of the SQLite stuff and PostgreSQL is working flawlessly with psycopg2... hmmm.
|
||||
- For reference, creating a PostgreSQL database for testing this locally (though `indexer.py` will create the table):
|
||||
|
||||
```
|
||||
$ createdb -h localhost -U postgres -O dspacestatistics --encoding=UNICODE dspacestatistics
|
||||
$ createuser -h localhost -U postgres --pwprompt dspacestatistics
|
||||
$ psql -h localhost -U postgres dspacestatistics
|
||||
dspacestatistics=> CREATE TABLE IF NOT EXISTS items
|
||||
dspacestatistics-> (id INT PRIMARY KEY, views INT DEFAULT 0, downloads INT DEFAULT 0)
|
||||
```
|
||||
|
||||
<!-- vim: set sw=2 ts=2: -->
|
||||
|
Reference in New Issue
Block a user