-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial database schema #53
Draft
mitchdowney
wants to merge
73
commits into
v5-develop
Choose a base branch
from
database-schema
base: v5-develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 37 commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
2d57521
Continue adding init database sql, and add inheritance tables
mitchdowney 6f21f91
Continue adding initial database schema
mitchdowney b18ccdf
Rename Podcasting 2.0 database init file
mitchdowney 173ef69
Add categories and missing NOT NULL to relationships
mitchdowney b156bd9
Add account table
mitchdowney 3f4d5c3
Set varchar_long to 2500; add chapter hash column
mitchdowney ddbc6f2
Add unique id to inherits tables that can only have one row per forei…
mitchdowney f9f08c0
Add clip table
mitchdowney f33f1c0
Add sharable_status to account and clip
mitchdowney 3c1001a
Fix item_chapter reference
mitchdowney bcaa8d8
Add playlist and playlist_item tables
mitchdowney cb89380
Rename clip table to item_clip
mitchdowney 858c505
Remove extra linebreaks
mitchdowney ee46019
Change short_id to short_id_v2
mitchdowney 54b4edb
Rename item_clip to clip
mitchdowney 02436e6
Add playlist_item_item_add_by_rss table
mitchdowney b9eb4a6
Rename playlist_item to playlist_content
mitchdowney 4478fe3
More initial helpers to their own sql file
mitchdowney e7911f3
Add updated_at handling to a couple columns
mitchdowney 075f34d
Add now_playing_content table
mitchdowney 1c45c62
Add queue_content table
mitchdowney 59f6827
Fix invalid table names
mitchdowney 38c2bf7
Add cascade delete rules to account sub-tables
mitchdowney 8264b6b
Continue initial database
mitchdowney 3d1b899
Add missing id serial to category
mitchdowney e667ce0
Rename playlist_content to playlist_resource
mitchdowney 6787cee
Replace most INHERITS tables with separate tables
mitchdowney 53e9244
Add account_following tables
mitchdowney 9c5b2d5
Add notes and cleanup 0001 migration
mitchdowney 22f4a8b
Move database sql files into migrations directory
mitchdowney 00fc443
Add combine_all_migrations script
mitchdowney f8d42a6
Add headers to migration files
mitchdowney 128ac6d
Add notification tables including up_device and fcm_device
mitchdowney 93375b9
Add paypal, apple, and google purchase tables
mitchdowney 5c641ec
Add account_claim_token table
mitchdowney 338c9ca
Update init_database.sql
mitchdowney a5df4c1
Continue updating initial database migrations
mitchdowney a855946
Remove bigint timestamp columns
mitchdowney 082c756
Updates to 0001 sql columns
mitchdowney 165198c
Update 0001 channel columns
mitchdowney f121021
Make channel title optional
mitchdowney 474df58
Update txt table names and columns
mitchdowney 3c615e3
Change value_tag to value
mitchdowney 4761e32
Remove unnecessary channel_value_time_split tables
mitchdowney 231435b
Change medium_value to medium
mitchdowney 3252aec
Change medium_value to medium; add guid_enclosure_url to item
mitchdowney 4e8887f
Update comment
mitchdowney 1ba48d3
Add item_chapters_feed_log
mitchdowney e105f5c
Remove unused item_chapters_feed log columns
mitchdowney 9b293ed
Add missing column to item_Person and item_season_episode
mitchdowney 23af605
Remove url column from item_soundbite
mitchdowney 571438a
Use numeric instead of integer for player times
mitchdowney c441896
Fix typos in "recipient" spelling
mitchdowney 8915aa8
Update item_season_episode table
mitchdowney dae2c66
Make protocol column required in chat tables
mitchdowney e5f05bf
Add last_parsed_file_hash column to feed table
mitchdowney 336c3bc
Fix item_chapter column name id_text
mitchdowney 15bb606
Remove item_chapter_image table
mitchdowney 868ae77
Update feed_log
mitchdowney 4a30352
Add podverse_queue and podverse_workers to docker compose
mitchdowney 908d3d7
Rename podverse_queue to podverse_amqp
mitchdowney a540f55
Remove podverse_workers from makefile
mitchdowney a38ae57
Change podverse_queue to podverse_amqp
mitchdowney 4b51c3e
Add podverse_network to docker-compose file
mitchdowney 9e9d519
Add podverse_workers_debug
mitchdowney d206bac
Add npm-link-modules.sh and add example env files
mitchdowney f5876b5
Add dev/local-dev-setup.md; Attach init_database.sql file to podverse…
mitchdowney c73a129
Update env examples; update npm-link-modules.sh; update docker-compos…
mitchdowney 0f90c1c
Update npm-link-modules.sh
mitchdowney dc82f5a
Add foreign key indexes
mitchdowney 250e6dd
Add comments to npm-link-modules.sh
mitchdowney 608c460
Update npm-link-modules
mitchdowney bf2403f
Fix OneToOne unique relationships; add indexes to remote_item tables
mitchdowney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
-- 0000 migration | ||
|
||
-- Helpers | ||
|
||
-- In the previous version of the app, short_id was 7-14 characters long. | ||
-- To make migration to v2 easier, we will use a 15 character long short_id, | ||
-- so we can easily distinguish between v1 and v2 short_ids. | ||
CREATE DOMAIN short_id_v2 AS VARCHAR(15); | ||
|
||
CREATE DOMAIN varchar_short AS VARCHAR(50); | ||
CREATE DOMAIN varchar_normal AS VARCHAR(255); | ||
CREATE DOMAIN varchar_long AS VARCHAR(2500); | ||
|
||
CREATE DOMAIN varchar_email AS VARCHAR(255) CHECK (VALUE ~ '^.+@.+\..+$'); | ||
CREATE DOMAIN varchar_fqdn AS VARCHAR(253); | ||
CREATE DOMAIN varchar_guid AS VARCHAR(36); | ||
CREATE DOMAIN varchar_password AS VARCHAR(36); | ||
CREATE DOMAIN varchar_slug AS VARCHAR(100); | ||
CREATE DOMAIN varchar_uri AS VARCHAR(2083); | ||
CREATE DOMAIN varchar_url AS VARCHAR(2083) CHECK (VALUE ~ '^https?://|^http?://'); | ||
|
||
CREATE DOMAIN server_time AS BIGINT; | ||
CREATE DOMAIN server_time_with_default AS BIGINT DEFAULT EXTRACT(EPOCH FROM NOW()); | ||
|
||
CREATE DOMAIN media_player_time AS NUMERIC(10, 2); | ||
CREATE DOMAIN list_position AS NUMERIC(22, 21); | ||
CREATE DOMAIN numeric_20_11 AS NUMERIC(20, 11); | ||
|
||
-- Function to set created_at and updated_at | ||
CREATE OR REPLACE FUNCTION set_updated_at_field() | ||
RETURNS TRIGGER AS $$ | ||
BEGIN | ||
NEW.updated_at := EXTRACT(EPOCH FROM NOW()); | ||
RETURN NEW; | ||
END; | ||
$$ LANGUAGE plpgsql; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mention in a previous comment about being consistent with data types. You are creating a domain here for url, using varchar. However, I know I saw at least one or two url columns using TEXT as the datatype. Again, neither options are incorrect-I think it would just bode well to try and stay as consistent as possible with your table structures and the data types you are using.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. At the moment I'm not sure which columns I missed with the
varchar_url
, but I do want to use that domain for all url columns.