killjaqular / picasso

Image database hosting.
0 stars 0 forks source link

Download Images #9

Open killjaqular opened 1 year ago

killjaqular commented 1 year ago

SQL:

CREATE TABLE IF NOT EXISTS uuids.uuid (
    uuid UUID PRIMARY KEY,
    parentTable VARCHAR(64) -- The table that contains the actual asset of the UUID
);

CREATE TABLE IF NOT EXISTS accounts.user (
    uuid UUID PRIMARY KEY REFERENCES uuids.uuid(uuid),
    username VARCHAR(16) UNIQUE, -- No repeated usernames allowed
    password VARCHAR(256) -- SHA256
);

-- It is recommended images be stored on local file disk versus database
-- We will store metadata here, like the path on the local file system
CREATE TABLE IF NOT EXISTS images.image (
    uuid UUID PRIMARY KEY REFERENCES uuids.uuid(uuid),
    filePath VARCHAR(255), -- Maximum directory length in the ext4 file system, common in Ubuntu
    userUUID UUID REFERENCES accounts.user(uuid) -- Foreign key referencing user UUID
);
killjaqular commented 1 year ago

TODO: Create a sketch of what this page should look like.