123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186 |
- --
- -- PostgreSQL database dump
- --
- -- Dumped from database version 11.1
- -- Dumped by pg_dump version 11.1
- --
- -- Name: access_tokens; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE access_tokens (
- id bigint NOT NULL,
- user_id text NOT NULL,
- device_id text,
- token text NOT NULL,
- last_used bigint
- );
- --
- -- Name: account_data; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE account_data (
- user_id text NOT NULL,
- account_data_type text NOT NULL,
- stream_id bigint NOT NULL,
- content text NOT NULL
- );
- --
- -- Name: account_data_max_stream_id; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE account_data_max_stream_id (
- lock character(1) DEFAULT 'X'::bpchar NOT NULL,
- stream_id bigint NOT NULL,
- CONSTRAINT private_user_data_max_stream_id_lock_check CHECK ((lock = 'X'::bpchar))
- );
- --
- -- Name: application_services; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE application_services (
- id bigint NOT NULL,
- url text,
- token text,
- hs_token text,
- sender text
- );
- --
- -- Name: application_services_regex; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE application_services_regex (
- id bigint NOT NULL,
- as_id bigint NOT NULL,
- namespace integer,
- regex text
- );
- --
- -- Name: application_services_state; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE application_services_state (
- as_id text NOT NULL,
- state character varying(5),
- last_txn integer
- );
- --
- -- Name: application_services_txns; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE application_services_txns (
- as_id text NOT NULL,
- txn_id integer NOT NULL,
- event_ids text NOT NULL
- );
- --
- -- Name: appservice_room_list; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE appservice_room_list (
- appservice_id text NOT NULL,
- network_id text NOT NULL,
- room_id text NOT NULL
- );
- --
- -- Name: appservice_stream_position; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE appservice_stream_position (
- lock character(1) DEFAULT 'X'::bpchar NOT NULL,
- stream_ordering bigint,
- CONSTRAINT appservice_stream_position_lock_check CHECK ((lock = 'X'::bpchar))
- );
- --
- -- Name: background_updates; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE background_updates (
- update_name text NOT NULL,
- progress_json text NOT NULL,
- depends_on text
- );
- --
- -- Name: blocked_rooms; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE blocked_rooms (
- room_id text NOT NULL,
- user_id text NOT NULL
- );
- --
- -- Name: cache_invalidation_stream; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE cache_invalidation_stream (
- stream_id bigint,
- cache_func text,
- keys text[],
- invalidation_ts bigint
- );
- --
- -- Name: current_state_delta_stream; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE current_state_delta_stream (
- stream_id bigint NOT NULL,
- room_id text NOT NULL,
- type text NOT NULL,
- state_key text NOT NULL,
- event_id text,
- prev_event_id text
- );
- --
- -- Name: current_state_events; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE current_state_events (
- event_id text NOT NULL,
- room_id text NOT NULL,
- type text NOT NULL,
- state_key text NOT NULL
- );
- --
- -- Name: current_state_resets; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE current_state_resets (
- event_stream_ordering bigint NOT NULL
- );
- --
- -- Name: deleted_pushers; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE deleted_pushers (
- stream_id bigint NOT NULL,
- app_id text NOT NULL,
- pushkey text NOT NULL,
- user_id text NOT NULL
- );
- --
- -- Name: destinations; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE destinations (
- destination text NOT NULL,
- retry_last_ts bigint,
- retry_interval integer
- );
- --
- -- Name: device_federation_inbox; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE device_federation_inbox (
- origin text NOT NULL,
- message_id text NOT NULL,
- received_ts bigint NOT NULL
- );
- --
- -- Name: device_federation_outbox; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE device_federation_outbox (
- destination text NOT NULL,
- stream_id bigint NOT NULL,
- queued_ts bigint NOT NULL,
- messages_json text NOT NULL
- );
- --
- -- Name: device_inbox; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE device_inbox (
- user_id text NOT NULL,
- device_id text NOT NULL,
- stream_id bigint NOT NULL,
- message_json text NOT NULL
- );
- --
- -- Name: device_lists_outbound_last_success; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE device_lists_outbound_last_success (
- destination text NOT NULL,
- user_id text NOT NULL,
- stream_id bigint NOT NULL
- );
- --
- -- Name: device_lists_outbound_pokes; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE device_lists_outbound_pokes (
- destination text NOT NULL,
- stream_id bigint NOT NULL,
- user_id text NOT NULL,
- device_id text NOT NULL,
- sent boolean NOT NULL,
- ts bigint NOT NULL
- );
- --
- -- Name: device_lists_remote_cache; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE device_lists_remote_cache (
- user_id text NOT NULL,
- device_id text NOT NULL,
- content text NOT NULL
- );
- --
- -- Name: device_lists_remote_extremeties; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE device_lists_remote_extremeties (
- user_id text NOT NULL,
- stream_id text NOT NULL
- );
- --
- -- Name: device_lists_stream; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE device_lists_stream (
- stream_id bigint NOT NULL,
- user_id text NOT NULL,
- device_id text NOT NULL
- );
- --
- -- Name: device_max_stream_id; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE device_max_stream_id (
- stream_id bigint NOT NULL
- );
- --
- -- Name: devices; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE devices (
- user_id text NOT NULL,
- device_id text NOT NULL,
- display_name text
- );
- --
- -- Name: e2e_device_keys_json; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE e2e_device_keys_json (
- user_id text NOT NULL,
- device_id text NOT NULL,
- ts_added_ms bigint NOT NULL,
- key_json text NOT NULL
- );
- --
- -- Name: e2e_one_time_keys_json; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE e2e_one_time_keys_json (
- user_id text NOT NULL,
- device_id text NOT NULL,
- algorithm text NOT NULL,
- key_id text NOT NULL,
- ts_added_ms bigint NOT NULL,
- key_json text NOT NULL
- );
- --
- -- Name: e2e_room_keys; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE e2e_room_keys (
- user_id text NOT NULL,
- room_id text NOT NULL,
- session_id text NOT NULL,
- version bigint NOT NULL,
- first_message_index integer,
- forwarded_count integer,
- is_verified boolean,
- session_data text NOT NULL
- );
- --
- -- Name: e2e_room_keys_versions; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE e2e_room_keys_versions (
- user_id text NOT NULL,
- version bigint NOT NULL,
- algorithm text NOT NULL,
- auth_data text NOT NULL,
- deleted smallint DEFAULT 0 NOT NULL
- );
- --
- -- Name: erased_users; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE erased_users (
- user_id text NOT NULL
- );
- --
- -- Name: event_auth; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_auth (
- event_id text NOT NULL,
- auth_id text NOT NULL,
- room_id text NOT NULL
- );
- --
- -- Name: event_backward_extremities; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_backward_extremities (
- event_id text NOT NULL,
- room_id text NOT NULL
- );
- --
- -- Name: event_content_hashes; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_content_hashes (
- event_id text,
- algorithm text,
- hash bytea
- );
- --
- -- Name: event_destinations; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_destinations (
- event_id text NOT NULL,
- destination text NOT NULL,
- delivered_ts bigint DEFAULT 0
- );
- --
- -- Name: event_edge_hashes; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_edge_hashes (
- event_id text,
- prev_event_id text,
- algorithm text,
- hash bytea
- );
- --
- -- Name: event_edges; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_edges (
- event_id text NOT NULL,
- prev_event_id text NOT NULL,
- room_id text NOT NULL,
- is_state boolean NOT NULL
- );
- --
- -- Name: event_forward_extremities; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_forward_extremities (
- event_id text NOT NULL,
- room_id text NOT NULL
- );
- --
- -- Name: event_json; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_json (
- event_id text NOT NULL,
- room_id text NOT NULL,
- internal_metadata text NOT NULL,
- json text NOT NULL
- );
- --
- -- Name: event_push_actions; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_push_actions (
- room_id text NOT NULL,
- event_id text NOT NULL,
- user_id text NOT NULL,
- profile_tag character varying(32),
- actions text NOT NULL,
- topological_ordering bigint,
- stream_ordering bigint,
- notif smallint,
- highlight smallint
- );
- --
- -- Name: event_push_actions_staging; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_push_actions_staging (
- event_id text NOT NULL,
- user_id text NOT NULL,
- actions text NOT NULL,
- notif smallint NOT NULL,
- highlight smallint NOT NULL
- );
- --
- -- Name: event_push_summary; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_push_summary (
- user_id text NOT NULL,
- room_id text NOT NULL,
- notif_count bigint NOT NULL,
- stream_ordering bigint NOT NULL
- );
- --
- -- Name: event_push_summary_stream_ordering; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_push_summary_stream_ordering (
- lock character(1) DEFAULT 'X'::bpchar NOT NULL,
- stream_ordering bigint NOT NULL,
- CONSTRAINT event_push_summary_stream_ordering_lock_check CHECK ((lock = 'X'::bpchar))
- );
- --
- -- Name: event_reference_hashes; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_reference_hashes (
- event_id text,
- algorithm text,
- hash bytea
- );
- --
- -- Name: event_reports; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_reports (
- id bigint NOT NULL,
- received_ts bigint NOT NULL,
- room_id text NOT NULL,
- event_id text NOT NULL,
- user_id text NOT NULL,
- reason text,
- content text
- );
- --
- -- Name: event_search; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_search (
- event_id text,
- room_id text,
- sender text,
- key text,
- vector tsvector,
- origin_server_ts bigint,
- stream_ordering bigint
- );
- --
- -- Name: event_signatures; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_signatures (
- event_id text,
- signature_name text,
- key_id text,
- signature bytea
- );
- --
- -- Name: event_to_state_groups; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE event_to_state_groups (
- event_id text NOT NULL,
- state_group bigint NOT NULL
- );
- --
- -- Name: events; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE events (
- stream_ordering integer NOT NULL,
- topological_ordering bigint NOT NULL,
- event_id text NOT NULL,
- type text NOT NULL,
- room_id text NOT NULL,
- content text,
- unrecognized_keys text,
- processed boolean NOT NULL,
- outlier boolean NOT NULL,
- depth bigint DEFAULT 0 NOT NULL,
- origin_server_ts bigint,
- received_ts bigint,
- sender text,
- contains_url boolean
- );
- --
- -- Name: ex_outlier_stream; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE ex_outlier_stream (
- event_stream_ordering bigint NOT NULL,
- event_id text NOT NULL,
- state_group bigint NOT NULL
- );
- --
- -- Name: federation_stream_position; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE federation_stream_position (
- type text NOT NULL,
- stream_id integer NOT NULL
- );
- --
- -- Name: feedback; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE feedback (
- event_id text NOT NULL,
- feedback_type text,
- target_event_id text,
- sender text,
- room_id text
- );
- --
- -- Name: group_attestations_remote; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE group_attestations_remote (
- group_id text NOT NULL,
- user_id text NOT NULL,
- valid_until_ms bigint NOT NULL,
- attestation_json text NOT NULL
- );
- --
- -- Name: group_attestations_renewals; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE group_attestations_renewals (
- group_id text NOT NULL,
- user_id text NOT NULL,
- valid_until_ms bigint NOT NULL
- );
- --
- -- Name: group_invites; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE group_invites (
- group_id text NOT NULL,
- user_id text NOT NULL
- );
- --
- -- Name: group_roles; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE group_roles (
- group_id text NOT NULL,
- role_id text NOT NULL,
- profile text NOT NULL,
- is_public boolean NOT NULL
- );
- --
- -- Name: group_room_categories; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE group_room_categories (
- group_id text NOT NULL,
- category_id text NOT NULL,
- profile text NOT NULL,
- is_public boolean NOT NULL
- );
- --
- -- Name: group_rooms; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE group_rooms (
- group_id text NOT NULL,
- room_id text NOT NULL,
- is_public boolean NOT NULL
- );
- --
- -- Name: group_summary_roles; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE group_summary_roles (
- group_id text NOT NULL,
- role_id text NOT NULL,
- role_order bigint NOT NULL,
- CONSTRAINT group_summary_roles_role_order_check CHECK ((role_order > 0))
- );
- --
- -- Name: group_summary_room_categories; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE group_summary_room_categories (
- group_id text NOT NULL,
- category_id text NOT NULL,
- cat_order bigint NOT NULL,
- CONSTRAINT group_summary_room_categories_cat_order_check CHECK ((cat_order > 0))
- );
- --
- -- Name: group_summary_rooms; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE group_summary_rooms (
- group_id text NOT NULL,
- room_id text NOT NULL,
- category_id text NOT NULL,
- room_order bigint NOT NULL,
- is_public boolean NOT NULL,
- CONSTRAINT group_summary_rooms_room_order_check CHECK ((room_order > 0))
- );
- --
- -- Name: group_summary_users; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE group_summary_users (
- group_id text NOT NULL,
- user_id text NOT NULL,
- role_id text NOT NULL,
- user_order bigint NOT NULL,
- is_public boolean NOT NULL
- );
- --
- -- Name: group_users; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE group_users (
- group_id text NOT NULL,
- user_id text NOT NULL,
- is_admin boolean NOT NULL,
- is_public boolean NOT NULL
- );
- --
- -- Name: groups; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE groups (
- group_id text NOT NULL,
- name text,
- avatar_url text,
- short_description text,
- long_description text,
- is_public boolean NOT NULL,
- join_policy text DEFAULT 'invite'::text NOT NULL
- );
- --
- -- Name: guest_access; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE guest_access (
- event_id text NOT NULL,
- room_id text NOT NULL,
- guest_access text NOT NULL
- );
- --
- -- Name: history_visibility; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE history_visibility (
- event_id text NOT NULL,
- room_id text NOT NULL,
- history_visibility text NOT NULL
- );
- --
- -- Name: local_group_membership; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE local_group_membership (
- group_id text NOT NULL,
- user_id text NOT NULL,
- is_admin boolean NOT NULL,
- membership text NOT NULL,
- is_publicised boolean NOT NULL,
- content text NOT NULL
- );
- --
- -- Name: local_group_updates; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE local_group_updates (
- stream_id bigint NOT NULL,
- group_id text NOT NULL,
- user_id text NOT NULL,
- type text NOT NULL,
- content text NOT NULL
- );
- --
- -- Name: local_invites; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE local_invites (
- stream_id bigint NOT NULL,
- inviter text NOT NULL,
- invitee text NOT NULL,
- event_id text NOT NULL,
- room_id text NOT NULL,
- locally_rejected text,
- replaced_by text
- );
- --
- -- Name: local_media_repository; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE local_media_repository (
- media_id text,
- media_type text,
- media_length integer,
- created_ts bigint,
- upload_name text,
- user_id text,
- quarantined_by text,
- url_cache text,
- last_access_ts bigint
- );
- --
- -- Name: local_media_repository_thumbnails; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE local_media_repository_thumbnails (
- media_id text,
- thumbnail_width integer,
- thumbnail_height integer,
- thumbnail_type text,
- thumbnail_method text,
- thumbnail_length integer
- );
- --
- -- Name: local_media_repository_url_cache; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE local_media_repository_url_cache (
- url text,
- response_code integer,
- etag text,
- expires_ts bigint,
- og text,
- media_id text,
- download_ts bigint
- );
- --
- -- Name: monthly_active_users; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE monthly_active_users (
- user_id text NOT NULL,
- "timestamp" bigint NOT NULL
- );
- --
- -- Name: open_id_tokens; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE open_id_tokens (
- token text NOT NULL,
- ts_valid_until_ms bigint NOT NULL,
- user_id text NOT NULL
- );
- --
- -- Name: presence; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE presence (
- user_id text NOT NULL,
- state character varying(20),
- status_msg text,
- mtime bigint
- );
- --
- -- Name: presence_allow_inbound; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE presence_allow_inbound (
- observed_user_id text NOT NULL,
- observer_user_id text NOT NULL
- );
- --
- -- Name: presence_list; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE presence_list (
- user_id text NOT NULL,
- observed_user_id text NOT NULL,
- accepted boolean NOT NULL
- );
- --
- -- Name: presence_stream; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE presence_stream (
- stream_id bigint,
- user_id text,
- state text,
- last_active_ts bigint,
- last_federation_update_ts bigint,
- last_user_sync_ts bigint,
- status_msg text,
- currently_active boolean
- );
- --
- -- Name: profiles; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE profiles (
- user_id text NOT NULL,
- displayname text,
- avatar_url text
- );
- --
- -- Name: public_room_list_stream; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE public_room_list_stream (
- stream_id bigint NOT NULL,
- room_id text NOT NULL,
- visibility boolean NOT NULL,
- appservice_id text,
- network_id text
- );
- --
- -- Name: push_rules; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE push_rules (
- id bigint NOT NULL,
- user_name text NOT NULL,
- rule_id text NOT NULL,
- priority_class smallint NOT NULL,
- priority integer DEFAULT 0 NOT NULL,
- conditions text NOT NULL,
- actions text NOT NULL
- );
- --
- -- Name: push_rules_enable; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE push_rules_enable (
- id bigint NOT NULL,
- user_name text NOT NULL,
- rule_id text NOT NULL,
- enabled smallint
- );
- --
- -- Name: push_rules_stream; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE push_rules_stream (
- stream_id bigint NOT NULL,
- event_stream_ordering bigint NOT NULL,
- user_id text NOT NULL,
- rule_id text NOT NULL,
- op text NOT NULL,
- priority_class smallint,
- priority integer,
- conditions text,
- actions text
- );
- --
- -- Name: pusher_throttle; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE pusher_throttle (
- pusher bigint NOT NULL,
- room_id text NOT NULL,
- last_sent_ts bigint,
- throttle_ms bigint
- );
- --
- -- Name: pushers; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE pushers (
- id bigint NOT NULL,
- user_name text NOT NULL,
- access_token bigint,
- profile_tag text NOT NULL,
- kind text NOT NULL,
- app_id text NOT NULL,
- app_display_name text NOT NULL,
- device_display_name text NOT NULL,
- pushkey text NOT NULL,
- ts bigint NOT NULL,
- lang text,
- data text,
- last_stream_ordering integer,
- last_success bigint,
- failing_since bigint
- );
- --
- -- Name: ratelimit_override; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE ratelimit_override (
- user_id text NOT NULL,
- messages_per_second bigint,
- burst_count bigint
- );
- --
- -- Name: receipts_graph; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE receipts_graph (
- room_id text NOT NULL,
- receipt_type text NOT NULL,
- user_id text NOT NULL,
- event_ids text NOT NULL,
- data text NOT NULL
- );
- --
- -- Name: receipts_linearized; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE receipts_linearized (
- stream_id bigint NOT NULL,
- room_id text NOT NULL,
- receipt_type text NOT NULL,
- user_id text NOT NULL,
- event_id text NOT NULL,
- data text NOT NULL
- );
- --
- -- Name: received_transactions; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE received_transactions (
- transaction_id text,
- origin text,
- ts bigint,
- response_code integer,
- response_json bytea,
- has_been_referenced smallint DEFAULT 0
- );
- --
- -- Name: redactions; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE redactions (
- event_id text NOT NULL,
- redacts text NOT NULL
- );
- --
- -- Name: rejections; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE rejections (
- event_id text NOT NULL,
- reason text NOT NULL,
- last_check text NOT NULL
- );
- --
- -- Name: remote_media_cache; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE remote_media_cache (
- media_origin text,
- media_id text,
- media_type text,
- created_ts bigint,
- upload_name text,
- media_length integer,
- filesystem_id text,
- last_access_ts bigint,
- quarantined_by text
- );
- --
- -- Name: remote_media_cache_thumbnails; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE remote_media_cache_thumbnails (
- media_origin text,
- media_id text,
- thumbnail_width integer,
- thumbnail_height integer,
- thumbnail_method text,
- thumbnail_type text,
- thumbnail_length integer,
- filesystem_id text
- );
- --
- -- Name: remote_profile_cache; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE remote_profile_cache (
- user_id text NOT NULL,
- displayname text,
- avatar_url text,
- last_check bigint NOT NULL
- );
- --
- -- Name: room_account_data; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE room_account_data (
- user_id text NOT NULL,
- room_id text NOT NULL,
- account_data_type text NOT NULL,
- stream_id bigint NOT NULL,
- content text NOT NULL
- );
- --
- -- Name: room_alias_servers; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE room_alias_servers (
- room_alias text NOT NULL,
- server text NOT NULL
- );
- --
- -- Name: room_aliases; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE room_aliases (
- room_alias text NOT NULL,
- room_id text NOT NULL,
- creator text
- );
- --
- -- Name: room_depth; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE room_depth (
- room_id text NOT NULL,
- min_depth integer NOT NULL
- );
- --
- -- Name: room_hosts; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE room_hosts (
- room_id text NOT NULL,
- host text NOT NULL
- );
- --
- -- Name: room_memberships; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE room_memberships (
- event_id text NOT NULL,
- user_id text NOT NULL,
- sender text NOT NULL,
- room_id text NOT NULL,
- membership text NOT NULL,
- forgotten integer DEFAULT 0,
- display_name text,
- avatar_url text
- );
- --
- -- Name: room_names; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE room_names (
- event_id text NOT NULL,
- room_id text NOT NULL,
- name text NOT NULL
- );
- --
- -- Name: room_tags; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE room_tags (
- user_id text NOT NULL,
- room_id text NOT NULL,
- tag text NOT NULL,
- content text NOT NULL
- );
- --
- -- Name: room_tags_revisions; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE room_tags_revisions (
- user_id text NOT NULL,
- room_id text NOT NULL,
- stream_id bigint NOT NULL
- );
- --
- -- Name: rooms; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE rooms (
- room_id text NOT NULL,
- is_public boolean,
- creator text
- );
- --
- -- Name: server_keys_json; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE server_keys_json (
- server_name text NOT NULL,
- key_id text NOT NULL,
- from_server text NOT NULL,
- ts_added_ms bigint NOT NULL,
- ts_valid_until_ms bigint NOT NULL,
- key_json bytea NOT NULL
- );
- --
- -- Name: server_signature_keys; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE server_signature_keys (
- server_name text,
- key_id text,
- from_server text,
- ts_added_ms bigint,
- verify_key bytea
- );
- --
- -- Name: server_tls_certificates; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE server_tls_certificates (
- server_name text,
- fingerprint text,
- from_server text,
- ts_added_ms bigint,
- tls_certificate bytea
- );
- --
- -- Name: state_events; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE state_events (
- event_id text NOT NULL,
- room_id text NOT NULL,
- type text NOT NULL,
- state_key text NOT NULL,
- prev_state text
- );
- --
- -- Name: state_forward_extremities; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE state_forward_extremities (
- event_id text NOT NULL,
- room_id text NOT NULL,
- type text NOT NULL,
- state_key text NOT NULL
- );
- --
- -- Name: state_group_edges; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE state_group_edges (
- state_group bigint NOT NULL,
- prev_state_group bigint NOT NULL
- );
- --
- -- Name: state_group_id_seq; Type: SEQUENCE; Schema: public; Owner: -
- --
- CREATE SEQUENCE state_group_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- --
- -- Name: state_groups; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE state_groups (
- id bigint NOT NULL,
- room_id text NOT NULL,
- event_id text NOT NULL
- );
- --
- -- Name: state_groups_state; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE state_groups_state (
- state_group bigint NOT NULL,
- room_id text NOT NULL,
- type text NOT NULL,
- state_key text NOT NULL,
- event_id text NOT NULL
- );
- --
- -- Name: stats_reporting; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE stats_reporting (
- reported_stream_token integer,
- reported_time bigint
- );
- --
- -- Name: stream_ordering_to_exterm; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE stream_ordering_to_exterm (
- stream_ordering bigint NOT NULL,
- room_id text NOT NULL,
- event_id text NOT NULL
- );
- --
- -- Name: threepid_guest_access_tokens; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE threepid_guest_access_tokens (
- medium text,
- address text,
- guest_access_token text,
- first_inviter text
- );
- --
- -- Name: topics; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE topics (
- event_id text NOT NULL,
- room_id text NOT NULL,
- topic text NOT NULL
- );
- --
- -- Name: transaction_id_to_pdu; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE transaction_id_to_pdu (
- transaction_id integer,
- destination text,
- pdu_id text,
- pdu_origin text
- );
- --
- -- Name: user_daily_visits; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE user_daily_visits (
- user_id text NOT NULL,
- device_id text,
- "timestamp" bigint NOT NULL
- );
- --
- -- Name: user_directory; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE user_directory (
- user_id text NOT NULL,
- room_id text,
- display_name text,
- avatar_url text
- );
- --
- -- Name: user_directory_search; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE user_directory_search (
- user_id text NOT NULL,
- vector tsvector
- );
- --
- -- Name: user_directory_stream_pos; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE user_directory_stream_pos (
- lock character(1) DEFAULT 'X'::bpchar NOT NULL,
- stream_id bigint,
- CONSTRAINT user_directory_stream_pos_lock_check CHECK ((lock = 'X'::bpchar))
- );
- --
- -- Name: user_filters; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE user_filters (
- user_id text,
- filter_id bigint,
- filter_json bytea
- );
- --
- -- Name: user_ips; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE user_ips (
- user_id text NOT NULL,
- access_token text NOT NULL,
- device_id text,
- ip text NOT NULL,
- user_agent text NOT NULL,
- last_seen bigint NOT NULL
- );
- --
- -- Name: user_threepids; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE user_threepids (
- user_id text NOT NULL,
- medium text NOT NULL,
- address text NOT NULL,
- validated_at bigint NOT NULL,
- added_at bigint NOT NULL
- );
- --
- -- Name: users; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE users (
- name text,
- password_hash text,
- creation_ts bigint,
- admin smallint DEFAULT 0 NOT NULL,
- upgrade_ts bigint,
- is_guest smallint DEFAULT 0 NOT NULL,
- appservice_id text,
- consent_version text,
- consent_server_notice_sent text,
- user_type text
- );
- --
- -- Name: users_in_public_rooms; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE users_in_public_rooms (
- user_id text NOT NULL,
- room_id text NOT NULL
- );
- --
- -- Name: users_pending_deactivation; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE users_pending_deactivation (
- user_id text NOT NULL
- );
- --
- -- Name: users_who_share_rooms; Type: TABLE; Schema: public; Owner: -
- --
- CREATE TABLE users_who_share_rooms (
- user_id text NOT NULL,
- other_user_id text NOT NULL,
- room_id text NOT NULL,
- share_private boolean NOT NULL
- );
- --
- -- Name: access_tokens access_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY access_tokens
- ADD CONSTRAINT access_tokens_pkey PRIMARY KEY (id);
- --
- -- Name: access_tokens access_tokens_token_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY access_tokens
- ADD CONSTRAINT access_tokens_token_key UNIQUE (token);
- --
- -- Name: account_data account_data_uniqueness; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY account_data
- ADD CONSTRAINT account_data_uniqueness UNIQUE (user_id, account_data_type);
- --
- -- Name: application_services application_services_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY application_services
- ADD CONSTRAINT application_services_pkey PRIMARY KEY (id);
- --
- -- Name: application_services_regex application_services_regex_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY application_services_regex
- ADD CONSTRAINT application_services_regex_pkey PRIMARY KEY (id);
- --
- -- Name: application_services_state application_services_state_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY application_services_state
- ADD CONSTRAINT application_services_state_pkey PRIMARY KEY (as_id);
- --
- -- Name: application_services application_services_token_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY application_services
- ADD CONSTRAINT application_services_token_key UNIQUE (token);
- --
- -- Name: application_services_txns application_services_txns_as_id_txn_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY application_services_txns
- ADD CONSTRAINT application_services_txns_as_id_txn_id_key UNIQUE (as_id, txn_id);
- --
- -- Name: appservice_stream_position appservice_stream_position_lock_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY appservice_stream_position
- ADD CONSTRAINT appservice_stream_position_lock_key UNIQUE (lock);
- --
- -- Name: background_updates background_updates_uniqueness; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY background_updates
- ADD CONSTRAINT background_updates_uniqueness UNIQUE (update_name);
- --
- -- Name: current_state_events current_state_events_event_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY current_state_events
- ADD CONSTRAINT current_state_events_event_id_key UNIQUE (event_id);
- --
- -- Name: current_state_events current_state_events_room_id_type_state_key_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY current_state_events
- ADD CONSTRAINT current_state_events_room_id_type_state_key_key UNIQUE (room_id, type, state_key);
- --
- -- Name: current_state_resets current_state_resets_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY current_state_resets
- ADD CONSTRAINT current_state_resets_pkey PRIMARY KEY (event_stream_ordering);
- --
- -- Name: destinations destinations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY destinations
- ADD CONSTRAINT destinations_pkey PRIMARY KEY (destination);
- --
- -- Name: devices device_uniqueness; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY devices
- ADD CONSTRAINT device_uniqueness UNIQUE (user_id, device_id);
- --
- -- Name: e2e_device_keys_json e2e_device_keys_json_uniqueness; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY e2e_device_keys_json
- ADD CONSTRAINT e2e_device_keys_json_uniqueness UNIQUE (user_id, device_id);
- --
- -- Name: e2e_one_time_keys_json e2e_one_time_keys_json_uniqueness; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY e2e_one_time_keys_json
- ADD CONSTRAINT e2e_one_time_keys_json_uniqueness UNIQUE (user_id, device_id, algorithm, key_id);
- --
- -- Name: event_backward_extremities event_backward_extremities_event_id_room_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY event_backward_extremities
- ADD CONSTRAINT event_backward_extremities_event_id_room_id_key UNIQUE (event_id, room_id);
- --
- -- Name: event_content_hashes event_content_hashes_event_id_algorithm_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY event_content_hashes
- ADD CONSTRAINT event_content_hashes_event_id_algorithm_key UNIQUE (event_id, algorithm);
- --
- -- Name: event_destinations event_destinations_event_id_destination_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY event_destinations
- ADD CONSTRAINT event_destinations_event_id_destination_key UNIQUE (event_id, destination);
- --
- -- Name: event_edge_hashes event_edge_hashes_event_id_prev_event_id_algorithm_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY event_edge_hashes
- ADD CONSTRAINT event_edge_hashes_event_id_prev_event_id_algorithm_key UNIQUE (event_id, prev_event_id, algorithm);
- --
- -- Name: event_edges event_edges_event_id_prev_event_id_room_id_is_state_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY event_edges
- ADD CONSTRAINT event_edges_event_id_prev_event_id_room_id_is_state_key UNIQUE (event_id, prev_event_id, room_id, is_state);
- --
- -- Name: event_forward_extremities event_forward_extremities_event_id_room_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY event_forward_extremities
- ADD CONSTRAINT event_forward_extremities_event_id_room_id_key UNIQUE (event_id, room_id);
- --
- -- Name: event_push_actions event_id_user_id_profile_tag_uniqueness; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY event_push_actions
- ADD CONSTRAINT event_id_user_id_profile_tag_uniqueness UNIQUE (room_id, event_id, user_id, profile_tag);
- --
- -- Name: event_json event_json_event_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY event_json
- ADD CONSTRAINT event_json_event_id_key UNIQUE (event_id);
- --
- -- Name: event_push_summary_stream_ordering event_push_summary_stream_ordering_lock_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY event_push_summary_stream_ordering
- ADD CONSTRAINT event_push_summary_stream_ordering_lock_key UNIQUE (lock);
- --
- -- Name: event_reference_hashes event_reference_hashes_event_id_algorithm_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY event_reference_hashes
- ADD CONSTRAINT event_reference_hashes_event_id_algorithm_key UNIQUE (event_id, algorithm);
- --
- -- Name: event_reports event_reports_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY event_reports
- ADD CONSTRAINT event_reports_pkey PRIMARY KEY (id);
- --
- -- Name: event_signatures event_signatures_event_id_signature_name_key_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY event_signatures
- ADD CONSTRAINT event_signatures_event_id_signature_name_key_id_key UNIQUE (event_id, signature_name, key_id);
- --
- -- Name: event_to_state_groups event_to_state_groups_event_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY event_to_state_groups
- ADD CONSTRAINT event_to_state_groups_event_id_key UNIQUE (event_id);
- --
- -- Name: events events_event_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY events
- ADD CONSTRAINT events_event_id_key UNIQUE (event_id);
- --
- -- Name: events events_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY events
- ADD CONSTRAINT events_pkey PRIMARY KEY (stream_ordering);
- --
- -- Name: ex_outlier_stream ex_outlier_stream_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY ex_outlier_stream
- ADD CONSTRAINT ex_outlier_stream_pkey PRIMARY KEY (event_stream_ordering);
- --
- -- Name: feedback feedback_event_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY feedback
- ADD CONSTRAINT feedback_event_id_key UNIQUE (event_id);
- --
- -- Name: group_roles group_roles_group_id_role_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY group_roles
- ADD CONSTRAINT group_roles_group_id_role_id_key UNIQUE (group_id, role_id);
- --
- -- Name: group_room_categories group_room_categories_group_id_category_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY group_room_categories
- ADD CONSTRAINT group_room_categories_group_id_category_id_key UNIQUE (group_id, category_id);
- --
- -- Name: group_summary_roles group_summary_roles_group_id_role_id_role_order_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY group_summary_roles
- ADD CONSTRAINT group_summary_roles_group_id_role_id_role_order_key UNIQUE (group_id, role_id, role_order);
- --
- -- Name: group_summary_room_categories group_summary_room_categories_group_id_category_id_cat_orde_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY group_summary_room_categories
- ADD CONSTRAINT group_summary_room_categories_group_id_category_id_cat_orde_key UNIQUE (group_id, category_id, cat_order);
- --
- -- Name: group_summary_rooms group_summary_rooms_group_id_category_id_room_id_room_order_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY group_summary_rooms
- ADD CONSTRAINT group_summary_rooms_group_id_category_id_room_id_room_order_key UNIQUE (group_id, category_id, room_id, room_order);
- --
- -- Name: guest_access guest_access_event_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY guest_access
- ADD CONSTRAINT guest_access_event_id_key UNIQUE (event_id);
- --
- -- Name: history_visibility history_visibility_event_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY history_visibility
- ADD CONSTRAINT history_visibility_event_id_key UNIQUE (event_id);
- --
- -- Name: local_media_repository local_media_repository_media_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY local_media_repository
- ADD CONSTRAINT local_media_repository_media_id_key UNIQUE (media_id);
- --
- -- Name: local_media_repository_thumbnails local_media_repository_thumbn_media_id_thumbnail_width_thum_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY local_media_repository_thumbnails
- ADD CONSTRAINT local_media_repository_thumbn_media_id_thumbnail_width_thum_key UNIQUE (media_id, thumbnail_width, thumbnail_height, thumbnail_type);
- --
- -- Name: user_threepids medium_address; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY user_threepids
- ADD CONSTRAINT medium_address UNIQUE (medium, address);
- --
- -- Name: open_id_tokens open_id_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY open_id_tokens
- ADD CONSTRAINT open_id_tokens_pkey PRIMARY KEY (token);
- --
- -- Name: presence_allow_inbound presence_allow_inbound_observed_user_id_observer_user_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY presence_allow_inbound
- ADD CONSTRAINT presence_allow_inbound_observed_user_id_observer_user_id_key UNIQUE (observed_user_id, observer_user_id);
- --
- -- Name: presence_list presence_list_user_id_observed_user_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY presence_list
- ADD CONSTRAINT presence_list_user_id_observed_user_id_key UNIQUE (user_id, observed_user_id);
- --
- -- Name: presence presence_user_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY presence
- ADD CONSTRAINT presence_user_id_key UNIQUE (user_id);
- --
- -- Name: account_data_max_stream_id private_user_data_max_stream_id_lock_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY account_data_max_stream_id
- ADD CONSTRAINT private_user_data_max_stream_id_lock_key UNIQUE (lock);
- --
- -- Name: profiles profiles_user_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY profiles
- ADD CONSTRAINT profiles_user_id_key UNIQUE (user_id);
- --
- -- Name: push_rules_enable push_rules_enable_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY push_rules_enable
- ADD CONSTRAINT push_rules_enable_pkey PRIMARY KEY (id);
- --
- -- Name: push_rules_enable push_rules_enable_user_name_rule_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY push_rules_enable
- ADD CONSTRAINT push_rules_enable_user_name_rule_id_key UNIQUE (user_name, rule_id);
- --
- -- Name: push_rules push_rules_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY push_rules
- ADD CONSTRAINT push_rules_pkey PRIMARY KEY (id);
- --
- -- Name: push_rules push_rules_user_name_rule_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY push_rules
- ADD CONSTRAINT push_rules_user_name_rule_id_key UNIQUE (user_name, rule_id);
- --
- -- Name: pusher_throttle pusher_throttle_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY pusher_throttle
- ADD CONSTRAINT pusher_throttle_pkey PRIMARY KEY (pusher, room_id);
- --
- -- Name: pushers pushers2_app_id_pushkey_user_name_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY pushers
- ADD CONSTRAINT pushers2_app_id_pushkey_user_name_key UNIQUE (app_id, pushkey, user_name);
- --
- -- Name: pushers pushers2_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY pushers
- ADD CONSTRAINT pushers2_pkey PRIMARY KEY (id);
- --
- -- Name: receipts_graph receipts_graph_uniqueness; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY receipts_graph
- ADD CONSTRAINT receipts_graph_uniqueness UNIQUE (room_id, receipt_type, user_id);
- --
- -- Name: receipts_linearized receipts_linearized_uniqueness; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY receipts_linearized
- ADD CONSTRAINT receipts_linearized_uniqueness UNIQUE (room_id, receipt_type, user_id);
- --
- -- Name: received_transactions received_transactions_transaction_id_origin_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY received_transactions
- ADD CONSTRAINT received_transactions_transaction_id_origin_key UNIQUE (transaction_id, origin);
- --
- -- Name: redactions redactions_event_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY redactions
- ADD CONSTRAINT redactions_event_id_key UNIQUE (event_id);
- --
- -- Name: rejections rejections_event_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY rejections
- ADD CONSTRAINT rejections_event_id_key UNIQUE (event_id);
- --
- -- Name: remote_media_cache remote_media_cache_media_origin_media_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY remote_media_cache
- ADD CONSTRAINT remote_media_cache_media_origin_media_id_key UNIQUE (media_origin, media_id);
- --
- -- Name: remote_media_cache_thumbnails remote_media_cache_thumbnails_media_origin_media_id_thumbna_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY remote_media_cache_thumbnails
- ADD CONSTRAINT remote_media_cache_thumbnails_media_origin_media_id_thumbna_key UNIQUE (media_origin, media_id, thumbnail_width, thumbnail_height, thumbnail_type);
- --
- -- Name: room_account_data room_account_data_uniqueness; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY room_account_data
- ADD CONSTRAINT room_account_data_uniqueness UNIQUE (user_id, room_id, account_data_type);
- --
- -- Name: room_aliases room_aliases_room_alias_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY room_aliases
- ADD CONSTRAINT room_aliases_room_alias_key UNIQUE (room_alias);
- --
- -- Name: room_depth room_depth_room_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY room_depth
- ADD CONSTRAINT room_depth_room_id_key UNIQUE (room_id);
- --
- -- Name: room_hosts room_hosts_room_id_host_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY room_hosts
- ADD CONSTRAINT room_hosts_room_id_host_key UNIQUE (room_id, host);
- --
- -- Name: room_memberships room_memberships_event_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY room_memberships
- ADD CONSTRAINT room_memberships_event_id_key UNIQUE (event_id);
- --
- -- Name: room_names room_names_event_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY room_names
- ADD CONSTRAINT room_names_event_id_key UNIQUE (event_id);
- --
- -- Name: room_tags_revisions room_tag_revisions_uniqueness; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY room_tags_revisions
- ADD CONSTRAINT room_tag_revisions_uniqueness UNIQUE (user_id, room_id);
- --
- -- Name: room_tags room_tag_uniqueness; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY room_tags
- ADD CONSTRAINT room_tag_uniqueness UNIQUE (user_id, room_id, tag);
- --
- -- Name: rooms rooms_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY rooms
- ADD CONSTRAINT rooms_pkey PRIMARY KEY (room_id);
- --
- -- Name: server_keys_json server_keys_json_uniqueness; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY server_keys_json
- ADD CONSTRAINT server_keys_json_uniqueness UNIQUE (server_name, key_id, from_server);
- --
- -- Name: server_signature_keys server_signature_keys_server_name_key_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY server_signature_keys
- ADD CONSTRAINT server_signature_keys_server_name_key_id_key UNIQUE (server_name, key_id);
- --
- -- Name: server_tls_certificates server_tls_certificates_server_name_fingerprint_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY server_tls_certificates
- ADD CONSTRAINT server_tls_certificates_server_name_fingerprint_key UNIQUE (server_name, fingerprint);
- --
- -- Name: state_events state_events_event_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY state_events
- ADD CONSTRAINT state_events_event_id_key UNIQUE (event_id);
- --
- -- Name: state_forward_extremities state_forward_extremities_event_id_room_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY state_forward_extremities
- ADD CONSTRAINT state_forward_extremities_event_id_room_id_key UNIQUE (event_id, room_id);
- --
- -- Name: state_groups state_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY state_groups
- ADD CONSTRAINT state_groups_pkey PRIMARY KEY (id);
- --
- -- Name: topics topics_event_id_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY topics
- ADD CONSTRAINT topics_event_id_key UNIQUE (event_id);
- --
- -- Name: transaction_id_to_pdu transaction_id_to_pdu_transaction_id_destination_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY transaction_id_to_pdu
- ADD CONSTRAINT transaction_id_to_pdu_transaction_id_destination_key UNIQUE (transaction_id, destination);
- --
- -- Name: user_directory_stream_pos user_directory_stream_pos_lock_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY user_directory_stream_pos
- ADD CONSTRAINT user_directory_stream_pos_lock_key UNIQUE (lock);
- --
- -- Name: users users_name_key; Type: CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY users
- ADD CONSTRAINT users_name_key UNIQUE (name);
- --
- -- Name: access_tokens_device_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX access_tokens_device_id ON access_tokens USING btree (user_id, device_id);
- --
- -- Name: account_data_stream_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX account_data_stream_id ON account_data USING btree (user_id, stream_id);
- --
- -- Name: application_services_txns_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX application_services_txns_id ON application_services_txns USING btree (as_id);
- --
- -- Name: appservice_room_list_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX appservice_room_list_idx ON appservice_room_list USING btree (appservice_id, network_id, room_id);
- --
- -- Name: blocked_rooms_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX blocked_rooms_idx ON blocked_rooms USING btree (room_id);
- --
- -- Name: cache_invalidation_stream_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX cache_invalidation_stream_id ON cache_invalidation_stream USING btree (stream_id);
- --
- -- Name: current_state_delta_stream_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX current_state_delta_stream_idx ON current_state_delta_stream USING btree (stream_id);
- --
- -- Name: current_state_events_member_index; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX current_state_events_member_index ON current_state_events USING btree (state_key) WHERE (type = 'm.room.member'::text);
- --
- -- Name: deleted_pushers_stream_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX deleted_pushers_stream_id ON deleted_pushers USING btree (stream_id);
- --
- -- Name: device_federation_inbox_sender_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX device_federation_inbox_sender_id ON device_federation_inbox USING btree (origin, message_id);
- --
- -- Name: device_federation_outbox_destination_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX device_federation_outbox_destination_id ON device_federation_outbox USING btree (destination, stream_id);
- --
- -- Name: device_federation_outbox_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX device_federation_outbox_id ON device_federation_outbox USING btree (stream_id);
- --
- -- Name: device_inbox_stream_id_user_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX device_inbox_stream_id_user_id ON device_inbox USING btree (stream_id, user_id);
- --
- -- Name: device_inbox_user_stream_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX device_inbox_user_stream_id ON device_inbox USING btree (user_id, device_id, stream_id);
- --
- -- Name: device_lists_outbound_last_success_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX device_lists_outbound_last_success_idx ON device_lists_outbound_last_success USING btree (destination, user_id, stream_id);
- --
- -- Name: device_lists_outbound_pokes_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX device_lists_outbound_pokes_id ON device_lists_outbound_pokes USING btree (destination, stream_id);
- --
- -- Name: device_lists_outbound_pokes_stream; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX device_lists_outbound_pokes_stream ON device_lists_outbound_pokes USING btree (stream_id);
- --
- -- Name: device_lists_outbound_pokes_user; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX device_lists_outbound_pokes_user ON device_lists_outbound_pokes USING btree (destination, user_id);
- --
- -- Name: device_lists_remote_cache_unique_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX device_lists_remote_cache_unique_id ON device_lists_remote_cache USING btree (user_id, device_id);
- --
- -- Name: device_lists_remote_extremeties_unique_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX device_lists_remote_extremeties_unique_idx ON device_lists_remote_extremeties USING btree (user_id);
- --
- -- Name: device_lists_stream_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX device_lists_stream_id ON device_lists_stream USING btree (stream_id, user_id);
- --
- -- Name: device_lists_stream_user_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX device_lists_stream_user_id ON device_lists_stream USING btree (user_id, device_id);
- --
- -- Name: e2e_room_keys_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX e2e_room_keys_idx ON e2e_room_keys USING btree (user_id, room_id, session_id);
- --
- -- Name: e2e_room_keys_versions_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX e2e_room_keys_versions_idx ON e2e_room_keys_versions USING btree (user_id, version);
- --
- -- Name: erased_users_user; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX erased_users_user ON erased_users USING btree (user_id);
- --
- -- Name: ev_b_extrem_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX ev_b_extrem_id ON event_backward_extremities USING btree (event_id);
- --
- -- Name: ev_b_extrem_room; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX ev_b_extrem_room ON event_backward_extremities USING btree (room_id);
- --
- -- Name: ev_edges_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX ev_edges_id ON event_edges USING btree (event_id);
- --
- -- Name: ev_edges_prev_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX ev_edges_prev_id ON event_edges USING btree (prev_event_id);
- --
- -- Name: ev_extrem_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX ev_extrem_id ON event_forward_extremities USING btree (event_id);
- --
- -- Name: ev_extrem_room; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX ev_extrem_room ON event_forward_extremities USING btree (room_id);
- --
- -- Name: evauth_edges_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX evauth_edges_id ON event_auth USING btree (event_id);
- --
- -- Name: event_contains_url_index; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX event_contains_url_index ON events USING btree (room_id, topological_ordering, stream_ordering) WHERE ((contains_url = true) AND (outlier = false));
- --
- -- Name: event_json_room_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX event_json_room_id ON event_json USING btree (room_id);
- --
- -- Name: event_push_actions_highlights_index; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX event_push_actions_highlights_index ON event_push_actions USING btree (user_id, room_id, topological_ordering, stream_ordering) WHERE (highlight = 1);
- --
- -- Name: event_push_actions_rm_tokens; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX event_push_actions_rm_tokens ON event_push_actions USING btree (user_id, room_id, topological_ordering, stream_ordering);
- --
- -- Name: event_push_actions_room_id_user_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX event_push_actions_room_id_user_id ON event_push_actions USING btree (room_id, user_id);
- --
- -- Name: event_push_actions_staging_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX event_push_actions_staging_id ON event_push_actions_staging USING btree (event_id);
- --
- -- Name: event_push_actions_stream_ordering; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX event_push_actions_stream_ordering ON event_push_actions USING btree (stream_ordering, user_id);
- --
- -- Name: event_push_actions_u_highlight; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX event_push_actions_u_highlight ON event_push_actions USING btree (user_id, stream_ordering);
- --
- -- Name: event_push_summary_user_rm; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX event_push_summary_user_rm ON event_push_summary USING btree (user_id, room_id);
- --
- -- Name: event_reference_hashes_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX event_reference_hashes_id ON event_reference_hashes USING btree (event_id);
- --
- -- Name: event_search_ev_ridx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX event_search_ev_ridx ON event_search USING btree (room_id);
- --
- -- Name: event_search_event_id_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX event_search_event_id_idx ON event_search USING btree (event_id);
- --
- -- Name: event_search_fts_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX event_search_fts_idx ON event_search USING gin (vector);
- --
- -- Name: event_to_state_groups_sg_index; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX event_to_state_groups_sg_index ON event_to_state_groups USING btree (state_group);
- --
- -- Name: events_order_room; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX events_order_room ON events USING btree (room_id, topological_ordering, stream_ordering);
- --
- -- Name: events_room_stream; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX events_room_stream ON events USING btree (room_id, stream_ordering);
- --
- -- Name: events_ts; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX events_ts ON events USING btree (origin_server_ts, stream_ordering);
- --
- -- Name: group_attestations_remote_g_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX group_attestations_remote_g_idx ON group_attestations_remote USING btree (group_id, user_id);
- --
- -- Name: group_attestations_remote_u_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX group_attestations_remote_u_idx ON group_attestations_remote USING btree (user_id);
- --
- -- Name: group_attestations_remote_v_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX group_attestations_remote_v_idx ON group_attestations_remote USING btree (valid_until_ms);
- --
- -- Name: group_attestations_renewals_g_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX group_attestations_renewals_g_idx ON group_attestations_renewals USING btree (group_id, user_id);
- --
- -- Name: group_attestations_renewals_u_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX group_attestations_renewals_u_idx ON group_attestations_renewals USING btree (user_id);
- --
- -- Name: group_attestations_renewals_v_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX group_attestations_renewals_v_idx ON group_attestations_renewals USING btree (valid_until_ms);
- --
- -- Name: group_invites_g_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX group_invites_g_idx ON group_invites USING btree (group_id, user_id);
- --
- -- Name: group_invites_u_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX group_invites_u_idx ON group_invites USING btree (user_id);
- --
- -- Name: group_rooms_g_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX group_rooms_g_idx ON group_rooms USING btree (group_id, room_id);
- --
- -- Name: group_rooms_r_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX group_rooms_r_idx ON group_rooms USING btree (room_id);
- --
- -- Name: group_summary_rooms_g_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX group_summary_rooms_g_idx ON group_summary_rooms USING btree (group_id, room_id, category_id);
- --
- -- Name: group_summary_users_g_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX group_summary_users_g_idx ON group_summary_users USING btree (group_id);
- --
- -- Name: group_users_g_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX group_users_g_idx ON group_users USING btree (group_id, user_id);
- --
- -- Name: group_users_u_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX group_users_u_idx ON group_users USING btree (user_id);
- --
- -- Name: groups_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX groups_idx ON groups USING btree (group_id);
- --
- -- Name: local_group_membership_g_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX local_group_membership_g_idx ON local_group_membership USING btree (group_id);
- --
- -- Name: local_group_membership_u_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX local_group_membership_u_idx ON local_group_membership USING btree (user_id, group_id);
- --
- -- Name: local_invites_for_user_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX local_invites_for_user_idx ON local_invites USING btree (invitee, locally_rejected, replaced_by, room_id);
- --
- -- Name: local_invites_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX local_invites_id ON local_invites USING btree (stream_id);
- --
- -- Name: local_media_repository_thumbnails_media_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX local_media_repository_thumbnails_media_id ON local_media_repository_thumbnails USING btree (media_id);
- --
- -- Name: local_media_repository_url_cache_by_url_download_ts; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX local_media_repository_url_cache_by_url_download_ts ON local_media_repository_url_cache USING btree (url, download_ts);
- --
- -- Name: local_media_repository_url_cache_expires_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX local_media_repository_url_cache_expires_idx ON local_media_repository_url_cache USING btree (expires_ts);
- --
- -- Name: local_media_repository_url_cache_media_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX local_media_repository_url_cache_media_idx ON local_media_repository_url_cache USING btree (media_id);
- --
- -- Name: local_media_repository_url_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX local_media_repository_url_idx ON local_media_repository USING btree (created_ts) WHERE (url_cache IS NOT NULL);
- --
- -- Name: monthly_active_users_time_stamp; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX monthly_active_users_time_stamp ON monthly_active_users USING btree ("timestamp");
- --
- -- Name: monthly_active_users_users; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX monthly_active_users_users ON monthly_active_users USING btree (user_id);
- --
- -- Name: open_id_tokens_ts_valid_until_ms; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX open_id_tokens_ts_valid_until_ms ON open_id_tokens USING btree (ts_valid_until_ms);
- --
- -- Name: presence_list_user_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX presence_list_user_id ON presence_list USING btree (user_id);
- --
- -- Name: presence_stream_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX presence_stream_id ON presence_stream USING btree (stream_id, user_id);
- --
- -- Name: presence_stream_user_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX presence_stream_user_id ON presence_stream USING btree (user_id);
- --
- -- Name: public_room_index; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX public_room_index ON rooms USING btree (is_public);
- --
- -- Name: public_room_list_stream_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX public_room_list_stream_idx ON public_room_list_stream USING btree (stream_id);
- --
- -- Name: public_room_list_stream_rm_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX public_room_list_stream_rm_idx ON public_room_list_stream USING btree (room_id, stream_id);
- --
- -- Name: push_rules_enable_user_name; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX push_rules_enable_user_name ON push_rules_enable USING btree (user_name);
- --
- -- Name: push_rules_stream_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX push_rules_stream_id ON push_rules_stream USING btree (stream_id);
- --
- -- Name: push_rules_stream_user_stream_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX push_rules_stream_user_stream_id ON push_rules_stream USING btree (user_id, stream_id);
- --
- -- Name: push_rules_user_name; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX push_rules_user_name ON push_rules USING btree (user_name);
- --
- -- Name: ratelimit_override_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX ratelimit_override_idx ON ratelimit_override USING btree (user_id);
- --
- -- Name: receipts_linearized_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX receipts_linearized_id ON receipts_linearized USING btree (stream_id);
- --
- -- Name: receipts_linearized_room_stream; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX receipts_linearized_room_stream ON receipts_linearized USING btree (room_id, stream_id);
- --
- -- Name: receipts_linearized_user; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX receipts_linearized_user ON receipts_linearized USING btree (user_id);
- --
- -- Name: received_transactions_ts; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX received_transactions_ts ON received_transactions USING btree (ts);
- --
- -- Name: redactions_redacts; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX redactions_redacts ON redactions USING btree (redacts);
- --
- -- Name: remote_profile_cache_time; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX remote_profile_cache_time ON remote_profile_cache USING btree (last_check);
- --
- -- Name: remote_profile_cache_user_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX remote_profile_cache_user_id ON remote_profile_cache USING btree (user_id);
- --
- -- Name: room_account_data_stream_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX room_account_data_stream_id ON room_account_data USING btree (user_id, stream_id);
- --
- -- Name: room_alias_servers_alias; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX room_alias_servers_alias ON room_alias_servers USING btree (room_alias);
- --
- -- Name: room_aliases_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX room_aliases_id ON room_aliases USING btree (room_id);
- --
- -- Name: room_depth_room; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX room_depth_room ON room_depth USING btree (room_id);
- --
- -- Name: room_memberships_room_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX room_memberships_room_id ON room_memberships USING btree (room_id);
- --
- -- Name: room_memberships_user_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX room_memberships_user_id ON room_memberships USING btree (user_id);
- --
- -- Name: room_names_room_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX room_names_room_id ON room_names USING btree (room_id);
- --
- -- Name: st_extrem_keys; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX st_extrem_keys ON state_forward_extremities USING btree (room_id, type, state_key);
- --
- -- Name: state_group_edges_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX state_group_edges_idx ON state_group_edges USING btree (state_group);
- --
- -- Name: state_group_edges_prev_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX state_group_edges_prev_idx ON state_group_edges USING btree (prev_state_group);
- --
- -- Name: state_groups_state_type_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX state_groups_state_type_idx ON state_groups_state USING btree (state_group, type, state_key);
- --
- -- Name: stream_ordering_to_exterm_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX stream_ordering_to_exterm_idx ON stream_ordering_to_exterm USING btree (stream_ordering);
- --
- -- Name: stream_ordering_to_exterm_rm_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX stream_ordering_to_exterm_rm_idx ON stream_ordering_to_exterm USING btree (room_id, stream_ordering);
- --
- -- Name: threepid_guest_access_tokens_index; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX threepid_guest_access_tokens_index ON threepid_guest_access_tokens USING btree (medium, address);
- --
- -- Name: topics_room_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX topics_room_id ON topics USING btree (room_id);
- --
- -- Name: transaction_id_to_pdu_dest; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX transaction_id_to_pdu_dest ON transaction_id_to_pdu USING btree (destination);
- --
- -- Name: user_daily_visits_ts_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX user_daily_visits_ts_idx ON user_daily_visits USING btree ("timestamp");
- --
- -- Name: user_daily_visits_uts_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX user_daily_visits_uts_idx ON user_daily_visits USING btree (user_id, "timestamp");
- --
- -- Name: user_directory_room_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX user_directory_room_idx ON user_directory USING btree (room_id);
- --
- -- Name: user_directory_search_fts_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX user_directory_search_fts_idx ON user_directory_search USING gin (vector);
- --
- -- Name: user_directory_search_user_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX user_directory_search_user_idx ON user_directory_search USING btree (user_id);
- --
- -- Name: user_directory_user_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX user_directory_user_idx ON user_directory USING btree (user_id);
- --
- -- Name: user_filters_by_user_id_filter_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX user_filters_by_user_id_filter_id ON user_filters USING btree (user_id, filter_id);
- --
- -- Name: user_ips_device_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX user_ips_device_id ON user_ips USING btree (user_id, device_id, last_seen);
- --
- -- Name: user_ips_device_unique_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX user_ips_device_unique_id ON user_ips USING btree (user_id, access_token, ip, user_agent, device_id);
- --
- -- Name: user_ips_last_seen; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX user_ips_last_seen ON user_ips USING btree (user_id, last_seen);
- --
- -- Name: user_ips_last_seen_only; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX user_ips_last_seen_only ON user_ips USING btree (last_seen);
- --
- -- Name: user_ips_user_ip; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX user_ips_user_ip ON user_ips USING btree (user_id, access_token, ip);
- --
- -- Name: user_threepids_medium_address; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX user_threepids_medium_address ON user_threepids USING btree (medium, address);
- --
- -- Name: user_threepids_user_id; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX user_threepids_user_id ON user_threepids USING btree (user_id);
- --
- -- Name: users_creation_ts; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX users_creation_ts ON users USING btree (creation_ts);
- --
- -- Name: users_in_public_rooms_room_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX users_in_public_rooms_room_idx ON users_in_public_rooms USING btree (room_id);
- --
- -- Name: users_in_public_rooms_user_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX users_in_public_rooms_user_idx ON users_in_public_rooms USING btree (user_id);
- --
- -- Name: users_who_share_rooms_o_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX users_who_share_rooms_o_idx ON users_who_share_rooms USING btree (other_user_id);
- --
- -- Name: users_who_share_rooms_r_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE INDEX users_who_share_rooms_r_idx ON users_who_share_rooms USING btree (room_id);
- --
- -- Name: users_who_share_rooms_u_idx; Type: INDEX; Schema: public; Owner: -
- --
- CREATE UNIQUE INDEX users_who_share_rooms_u_idx ON users_who_share_rooms USING btree (user_id, other_user_id);
- --
- -- Name: application_services_regex application_services_regex_as_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
- --
- ALTER TABLE ONLY application_services_regex
- ADD CONSTRAINT application_services_regex_as_id_fkey FOREIGN KEY (as_id) REFERENCES application_services(id);
- --
- -- PostgreSQL database dump complete
- --
|