{"action":"created","issue":{"url":"https://api.github.com/repos/tgstation/-tg-station/issues/15680","repository_url":"https://api.github.com/repos/tgstation/-tg-station","labels_url":"https://api.github.com/repos/tgstation/-tg-station/issues/15680/labels{/name}","comments_url":"https://api.github.com/repos/tgstation/-tg-station/issues/15680/comments","events_url":"https://api.github.com/repos/tgstation/-tg-station/issues/15680/events","html_url":"https://github.com/tgstation/-tg-station/pull/15680","id":135295451,"number":15680,"title":"[Testing] Ban/DB overhaul","user":{"login":"tkdrg","id":6563111,"avatar_url":"https://avatars.githubusercontent.com/u/6563111?v=3","gravatar_id":"","url":"https://api.github.com/users/tkdrg","html_url":"https://github.com/tkdrg","followers_url":"https://api.github.com/users/tkdrg/followers","following_url":"https://api.github.com/users/tkdrg/following{/other_user}","gists_url":"https://api.github.com/users/tkdrg/gists{/gist_id}","starred_url":"https://api.github.com/users/tkdrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkdrg/subscriptions","organizations_url":"https://api.github.com/users/tkdrg/orgs","repos_url":"https://api.github.com/users/tkdrg/repos","events_url":"https://api.github.com/users/tkdrg/events{/privacy}","received_events_url":"https://api.github.com/users/tkdrg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tgstation/-tg-station/labels/Administration","name":"Administration","color":"eb6420"},{"url":"https://api.github.com/repos/tgstation/-tg-station/labels/Refactor","name":"Refactor","color":"ffaa00"},{"url":"https://api.github.com/repos/tgstation/-tg-station/labels/Work%20In%20Progress","name":"Work In Progress","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-02-22T02:28:38Z","updated_at":"2016-03-24T21:35:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/tgstation/-tg-station/pulls/15680","html_url":"https://github.com/tgstation/-tg-station/pull/15680","diff_url":"https://github.com/tgstation/-tg-station/pull/15680.diff","patch_url":"https://github.com/tgstation/-tg-station/pull/15680.patch"},"body":"Let's declutter these awful tables from legacy junk and old snowflake. Basically what @MrStonedOne said in #8584 aka everything is now a job ban (renamed to \"role ban\")\r\n- [x] Turn appearance bans into job bans (incl. migration)\r\n- [x] Remove temp vs perma bans, make expiration_time allow NULL, and if expiration_time is NULL, perma, else, temp.\r\n- [x] Remove admin ban, make that a field. 'Applies to admins', now we can have admin job bans.\r\n- [x] Remove type, if role is null, its a server ban, else role/job ban.\r\n- [x] Remove duration, it's not used, expiration_time is.\r\n- [x] Remove the rounds column, as it is unused.\r\n- [x] Ultimately remove bantype as it will be implied by the db entry.\r\n- [x] ~~Rename job ban to role ban~~ Deferred due to laziness.\r\n- [x] Write up something to alter the old tables to the new schema.\r\n- [x] Write up some migration proc to convert old server/admin bans to the new schema\r\n- [x] Fix the default schema to get rid of duration/bantype & add the admin field.\r\n- [ ] Test everything (haha as if).\r\n\r\nFixes #8584 and probably a bunch of other issues that I can't be assed to find.\r\nMore importantly, it improves and reorganizes ban code, kills snowflake, deprecates the million old ban systems that we have in favor of db bans (though I might keep legacy server permabans around for people who just want a simple private server without the hassle of SQL, and I know mso has some plans for something along the lines of SQlite-based flat file DBs which would render that point moot), reduces the total amount of columns in the DB, and makes the dm code leaner and cleaner."},"comment":{"url":"https://api.github.com/repos/tgstation/-tg-station/issues/comments/201034423","html_url":"https://github.com/tgstation/-tg-station/pull/15680#issuecomment-201034423","issue_url":"https://api.github.com/repos/tgstation/-tg-station/issues/15680","id":201034423,"user":{"login":"MrStonedOne","id":7069733,"avatar_url":"https://avatars.githubusercontent.com/u/7069733?v=3","gravatar_id":"","url":"https://api.github.com/users/MrStonedOne","html_url":"https://github.com/MrStonedOne","followers_url":"https://api.github.com/users/MrStonedOne/followers","following_url":"https://api.github.com/users/MrStonedOne/following{/other_user}","gists_url":"https://api.github.com/users/MrStonedOne/gists{/gist_id}","starred_url":"https://api.github.com/users/MrStonedOne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrStonedOne/subscriptions","organizations_url":"https://api.github.com/users/MrStonedOne/orgs","repos_url":"https://api.github.com/users/MrStonedOne/repos","events_url":"https://api.github.com/users/MrStonedOne/events{/privacy}","received_events_url":"https://api.github.com/users/MrStonedOne/received_events","type":"User","site_admin":false},"created_at":"2016-03-24T21:35:24Z","updated_at":"2016-03-24T21:35:24Z","body":"at some point, yes."}}