diff options
Diffstat (limited to 'migrations')
| -rw-r--r-- | migrations/20250117_224217_create_storage_object.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/migrations/20250117_224217_create_storage_object.php b/migrations/20250117_224217_create_storage_object.php new file mode 100644 index 0000000..a1a5cc0 --- /dev/null +++ b/migrations/20250117_224217_create_storage_object.php @@ -0,0 +1,21 @@ +<?php + +use \Digitigrade\Db\Migrator; + +Migrator::getInstance()->register(20250117_224217, function (PDO $db) { + // storage objects for uploaded files and whatever else needs storing + // backend agnostic! that's cool i think + // note: i'm using random strings for the primary key here because i don't + // want them to be easily guessable. i think this is an okay tradeoff + $db->exec(<<<END + CREATE TABLE storage_object ( + oid text primary key, + provider text not null, + token text not null, + filename text not null, + mimetype text not null, + created timestamp with time zone not null default current_timestamp, + unique(provider, token) + ); + END); +}); |
