diff options
| author | Nathan Perry <avaglir@gmail.com> | 2018-04-05 22:52:02 -0400 |
|---|---|---|
| committer | Nathan Perry <avaglir@gmail.com> | 2018-04-05 22:52:02 -0400 |
| commit | ee1d099c6acdb38a173a7455804724f3a1b78836 (patch) | |
| tree | 0f4a8a949de370874d3e61788f5882dd7dddcf43 /src/db/schema.rs | |
| parent | 1fda857d25c3d33e593951eef3ce713fa69a7025 (diff) | |
consolidate memes to one table
Diffstat (limited to 'src/db/schema.rs')
| -rw-r--r-- | src/db/schema.rs | 46 |
1 files changed, 11 insertions, 35 deletions
diff --git a/src/db/schema.rs b/src/db/schema.rs index 40891a5..cf15dcd 100644 --- a/src/db/schema.rs +++ b/src/db/schema.rs @@ -7,15 +7,6 @@ table! { } table! { - audio_memes (id) { - id -> Int4, - title -> Varchar, - audio_id -> Int4, - metadata_id -> Int4, - } -} - -table! { audit_records (id) { id -> Int4, updated -> Timestamp, @@ -25,18 +16,20 @@ table! { } table! { - image_memes (id) { + images (id) { id -> Int4, - title -> Varchar, - image_id -> Int4, + data -> Bytea, metadata_id -> Int4, } } table! { - images (id) { + memes (id) { id -> Int4, - data -> Bytea, + title -> Varchar, + content -> Nullable<Text>, + image_id -> Nullable<Int4>, + audio_id -> Nullable<Int4>, metadata_id -> Int4, } } @@ -49,34 +42,17 @@ table! { } } -table! { - text_memes (id) { - id -> Int4, - title -> Varchar, - content -> Text, - image_id -> Nullable<Int4>, - audio_id -> Nullable<Int4>, - metadata_id -> Int4, - } -} - joinable!(audio -> metadata (metadata_id)); -joinable!(audio_memes -> audio (audio_id)); -joinable!(audio_memes -> metadata (metadata_id)); joinable!(audit_records -> metadata (metadata_id)); -joinable!(image_memes -> images (image_id)); -joinable!(image_memes -> metadata (metadata_id)); joinable!(images -> metadata (metadata_id)); -joinable!(text_memes -> audio (audio_id)); -joinable!(text_memes -> images (image_id)); -joinable!(text_memes -> metadata (metadata_id)); +joinable!(memes -> audio (audio_id)); +joinable!(memes -> images (image_id)); +joinable!(memes -> metadata (metadata_id)); allow_tables_to_appear_in_same_query!( audio, - audio_memes, audit_records, - image_memes, images, + memes, metadata, - text_memes, ); |
