You've already forked AstralRinth
forked from didirus/AstralRinth
General cleanup: fix some bugs, some refactoring (#65)
* Merged mod file upload in version creation, mod creation and
version file add to one function; This makes sure that they are
consistent
* Made some fields on `User` optional: `github_id`, `avatar_url`, `bio`.
* We may not want to publicly show the `github_id` to everyone
with access to the API
* If we allow non-github users, some of those fields would be
invalid; some oauth providers may not have avatars or bios
* Made CORS origins should configurable
* Made `--reconfigure-indices` and `--reset-indices` exit after
completion instead of starting the server
This commit is contained in:
35
migrations/20201001015631_not-null-github-avatar.sql
Normal file
35
migrations/20201001015631_not-null-github-avatar.sql
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
-- Originally:
|
||||
-- ALTER TABLE users
|
||||
-- ADD COLUMN github_id bigint NOT NULL default 0,
|
||||
-- ADD COLUMN username varchar(255) NOT NULL default 'username',
|
||||
-- ADD COLUMN name varchar(255) NOT NULL default 'John Doe',
|
||||
-- ADD COLUMN email varchar(255) NULL default 'johndoe@modrinth.com',
|
||||
-- ADD COLUMN avatar_url varchar(500) NOT NULL default '...',
|
||||
-- ADD COLUMN bio varchar(160) NOT NULL default 'I make mods!',
|
||||
-- ADD COLUMN created timestamptz default CURRENT_TIMESTAMP NOT NULL
|
||||
|
||||
-- We don't want garbage data when users are created incorrectly;
|
||||
-- we just want it to fail.
|
||||
|
||||
ALTER TABLE users
|
||||
ALTER COLUMN github_id DROP NOT NULL;
|
||||
ALTER TABLE users
|
||||
ALTER COLUMN github_id DROP DEFAULT;
|
||||
|
||||
ALTER TABLE users
|
||||
ALTER COLUMN avatar_url DROP NOT NULL;
|
||||
ALTER TABLE users
|
||||
ALTER COLUMN avatar_url DROP DEFAULT;
|
||||
|
||||
ALTER TABLE users
|
||||
ALTER COLUMN username DROP DEFAULT;
|
||||
ALTER TABLE users
|
||||
ALTER COLUMN name DROP DEFAULT;
|
||||
ALTER TABLE users
|
||||
ALTER COLUMN email DROP DEFAULT;
|
||||
|
||||
ALTER TABLE users
|
||||
ALTER COLUMN bio DROP DEFAULT;
|
||||
ALTER TABLE users
|
||||
ALTER COLUMN bio DROP NOT NULL;
|
||||
Reference in New Issue
Block a user