Commit Graph

48 Commits

Author SHA1 Message Date
5df82973ee
db.model: Implement get_user/get_deferral using single-row fetch 2018-12-31 17:07:38 +10:00
92366b6003
db.model.User: Add rm_groups 2018-12-31 17:07:19 +10:00
4323629c4a
db.model: Implement row refreshes. 2018-12-31 17:06:35 +10:00
b4f36fb737
db.model: Implement single-row fetches. 2018-12-31 17:06:15 +10:00
7be8c9e2c3
db.model: Fix list join
I always seem to get JavaScript's `Array.join` and Python's `str.join`
muddled.
2018-12-31 17:04:27 +10:00
70abfedbf5
db.model: Implement property getters/setters 2018-12-31 17:02:38 +10:00
a9262430a6
db: Replace SQLAlchemy with pscopg2.
Rather than use SQLAlchemy, which suffers from not being thread-safe
along with other failings, we'll use an ORM of our own design built on
`psycopg2`.  This will run in a separate thread.
2018-12-31 12:46:01 +10:00
4cc1f337f7
db.model: Fix table name in foreign key. 2018-12-26 14:13:27 +10:00
d0efdc6bfe
db.model: Add trait instance pairs 2018-12-26 13:26:08 +10:00
9da9b365ec
db.model: Link users and traits. 2018-12-21 19:06:29 +10:00
cfa65df15f
db.model: Drop score and count from AvatarHash.
We're scoring this now as trait instances.
2018-12-18 22:23:31 +10:00
99b033010f
db.model: Expose trait instance data. 2018-12-18 21:30:51 +10:00
0b83cd9ebc
db.model: Add weighting to traits.
Not all traits are equal, some may be more significant than others.
We'll keep a weighting in the database, which we can manipulate through
SQL commands.
2018-12-18 20:38:15 +10:00
02bb22d872
db.model: De-pluralise classes. 2018-12-18 20:20:53 +10:00
6a469e87fd
db.model: Set tables on UserTrait and UserTraitInstance. 2018-12-13 08:00:22 +10:00
a471e11573
db.model: Add trait tables. 2018-12-13 07:55:01 +10:00
f225f3b58a
db.model: Form User-Avatar relationship. 2018-12-05 22:23:50 +10:00
b59235355c
db.model: Make score and count fields not-null default 0. 2018-11-30 20:16:07 +10:00
3c607dc16a
db.model: Add scoring to avatar hashes. 2018-11-27 20:57:47 +10:00
31b2e162cd
db: Add AvatarHash and relations
`AvatarHash` will store the hash of all avatars in the database,
allowing for similar images to be compared.

The spammers tend to upload identical or near-identical avatars to their
profiles, so this should be a good way of auto-detecting new spam links.
2018-11-26 21:02:14 +10:00
d1e0e6d967
db: Add local account table.
For when Hackaday.io's API is blocked, or when the token they give you
plain doesn't work, this allows a user to be given alternate
authentication credentials with which to log in.
2018-11-26 07:39:42 +10:00
29bf47b10e
db.model: Add new user object.
To represent users that have been discovered and need to be inspected.
2018-07-02 22:39:09 +10:00
d98761c1bb
db.model: Add hostnames field to User 2018-06-03 17:58:56 +10:00
3dfe434fc1
db.model: Add Hostname and UserHostname
These will track the host name used in users' links and score them, as
the spammers seem to like pushing the same addresses over and over.

(Long term, I want to de-reference redirected links like t.co too.)
2018-06-03 17:49:11 +10:00
999179ae85
db.model: Fix representation for UserWord. 2018-06-03 17:48:04 +10:00
c2b500a8a5
db.model: Add had_created.
I note that newer users, you see the actual creation time, but for older
users, this is reported as 0.  So, store the value as-given, rather than
fudging it.  `created` will now reflect when we first saw the user.
2018-06-02 13:13:17 +10:00
f5e83670eb
db.model: Add missed __tablename__ 2018-03-03 11:36:14 +10:00
800fff3a49
db.model: Add deferred user to database.
This allows us to persist deferred users, so that we can re-visit new
accounts that perhaps had no content to inspect when first created.
2018-03-03 11:19:09 +10:00
dda54cd23a
db.model: Add string representations 2018-03-01 22:38:50 +10:00
684640fbf3
db: Add UserToken
Sometimes the regular expression picks up on tokens, and so we want to
be able to display that so the classifier isn't left scratching their
head as to why someone is suspect.
2018-02-03 10:02:58 +10:00
b329f550c7
db: Add UserWord and UserWordAdjacent object
This tracks the number of times a user uses a word or pair of words.
2018-02-03 09:59:23 +10:00
1d9c2a49c2
db.model: Add tables for recording word frequency/adjacency. 2018-02-02 22:06:32 +10:00
493aa20e9e
db.model: Add number of projects to user data. 2018-02-02 11:49:32 +10:00
ded09d57ba
db.model: Add expiry date to session 2018-01-17 19:34:29 +10:00
d5c603cf50
db.model: Add what_i_would_like_to_do column 2018-01-08 22:35:55 +10:00
a2445367d2
db.model: Drop user token.
We don't really need it beyond identifying the user during log-in.
2018-01-08 22:31:51 +10:00
f2d8ffe2d9
db.model: Delete children when user is deleted. 2018-01-08 22:15:34 +10:00
42432241d3
model: Fix reference on Tags 2018-01-07 15:16:50 +10:00
2dbf81f6eb
db.model: Model many-to-many properly. 2018-01-07 14:56:56 +10:00
4c979ecc43
db.model: Add page refresh metadata. 2018-01-07 14:10:04 +10:00
db3c47dd89
db.model: Add creation date to user 2018-01-07 14:03:25 +10:00
e7677be5f9
db.model: Fix primary keys on UserLink 2018-01-06 20:56:07 +10:00
4b6b7cf255
db.model: Re-locate misplaced 'location' 2018-01-06 20:43:01 +10:00
e77da5e032
db.model: Put back-references into User 2018-01-06 19:23:46 +10:00
21e9c5fcf4
db.model: Relate users to their sub-objects. 2018-01-06 19:20:22 +10:00
dd10df913a
db.model: Pass UUIDs as UUIDs not strings. 2018-01-06 19:02:16 +10:00
f5ce8e2331
db: Fix missed import 2018-01-06 18:26:06 +10:00
4009de4329
db: Add in beginnings of model. 2018-01-06 13:59:57 +10:00