Implement extension registration from an extension.json file
[mediawiki.git] / maintenance / oracle / archives / patch-uploadstash.sql
blob3e37ceffe67e114c09c21fd7c4ed7eccf165fe38
1 define mw_prefix='{$wgDBprefix}';
3 CREATE SEQUENCE uploadstash_us_id_seq;
4 CREATE TABLE &mw_prefix.uploadstash (
5         us_id                 NUMBER       NOT NULL,
6   us_user               NUMBER          DEFAULT 0 NOT NULL,
7         us_key                                                          VARCHAR2(255) NOT NULL,
8         us_orig_path                                    VARCHAR2(255) NOT NULL,
9         us_path                                                         VARCHAR2(255) NOT NULL,
10         us_source_type                          VARCHAR2(50),
11   us_timestamp          TIMESTAMP(6) WITH TIME ZONE,
12         us_status                                                       VARCHAR2(50) NOT NULL,
13         us_size                                                         NUMBER NOT NULL,
14         us_sha1                                                         VARCHAR2(32) NOT NULL,
15         us_mime                                                         VARCHAR2(255),
16   us_media_type         VARCHAR2(32) DEFAULT NULL,
17         us_image_width                          NUMBER,
18         us_image_height                         NUMBER,
19         us_image_bits                                   NUMBER
21 ALTER TABLE &mw_prefix.uploadstash ADD CONSTRAINT &mw_prefix.uploadstash_pk PRIMARY KEY (us_id);
22 ALTER TABLE &mw_prefix.uploadstash ADD CONSTRAINT &mw_prefix.uploadstash_fk1 FOREIGN KEY (us_user) REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED;
23 CREATE INDEX &mw_prefix.uploadstash_i01 ON &mw_prefix.uploadstash (us_user);
24 CREATE INDEX &mw_prefix.uploadstash_i02 ON &mw_prefix.uploadstash (us_timestamp);
25 CREATE UNIQUE INDEX &mw_prefix.uploadstash_u01 ON &mw_prefix.uploadstash (us_key);