You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: internal/database/init.go
+9-3
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ import (
10
10
"github.com/jmoiron/sqlx"
11
11
)
12
12
13
-
constcurrentVersion=4
13
+
constcurrentVersion=5
14
14
15
15
typemigrateMapstruct {
16
16
SQLstring
@@ -37,12 +37,18 @@ var migrateSQL = map[int]migrateMap{
37
37
4: {
38
38
SQL: `
39
39
ALTER TABLE categories ADD COLUMN igdb_id text not null default 0; UPDATE categories SET igdb_id = abs(random() % 100000); ALTER TABLE clips ADD COLUMN vod_offset int default 0; UPDATE clips SET vod_offset = abs(random() % 3000); ALTER TABLE drops_entitlements ADD COLUMN last_updated text default '2023-01-01T04:17:53.325Z';
40
-
CREATE TABLE chat_settings( broadcaster_id text not null primary key, slow_mode boolean not null default 0, slow_mode_wait_time int not null default 10, follower_mode boolean not null default 0, follower_mode_duration int not null default 60, subscriber_mode boolean not null default 0, emote_mode boolean not null default 0, unique_chat_mode boolean not null default 0, non_moderator_chat_delay boolean not null default 0, non_moderator_chat_delay_duration int not null default 10, shieldmode_is_active boolean not null default 0, shieldmode_moderator_id text not null default '', shieldmode_moderator_login text not null default '', shieldmode_moderator_name text not null default '', shieldmode_last_activated text not null default '' );
40
+
CREATE TABLE chat_settings (broadcaster_id text not null primary key, slow_mode boolean not null default 0, slow_mode_wait_time int not null default 10, follower_mode boolean not null default 0, follower_mode_duration int not null default 60, subscriber_mode boolean not null default 0, emote_mode boolean not null default 0, unique_chat_mode boolean not null default 0, non_moderator_chat_delay boolean not null default 0, non_moderator_chat_delay_duration int not null default 10, shieldmode_is_active boolean not null default 0, shieldmode_moderator_id text not null default '', shieldmode_moderator_login text not null default '', shieldmode_moderator_name text not null default '', shieldmode_last_activated text not null default '' );
41
41
INSERT INTO chat_settings (broadcaster_id) SELECT id FROM users;
42
42
ALTER TABLE users ADD COLUMN chat_color text not null default '#9146FF';
43
43
CREATE TABLE vips ( broadcaster_id text not null, user_id text not null, created_at text not null default '', primary key (broadcaster_id, user_id), foreign key (broadcaster_id) references users(id), foreign key (user_id) references users(id) );`,
44
44
Message: `Updating database to include API changes since last version. See Twitch CLI changelog for more info.`,
45
45
},
46
+
5: {
47
+
SQL: `
48
+
ALTER TABLE users ADD COLUMN branded_content boolean not null default false;
49
+
ALTER TABLE users ADD COLUMN content_labels text not null default '';`,
50
+
Message: `Updating database to include Content Classification Label field.`,
create table events( id text not null primary key, event text not null, json text not null, from_user text not null, to_user text not null, transport text not null, timestamp text not null);
83
89
create table categories( id text not null primary key, category_name text not null, igdb_id text not null );
84
-
create table users( id text not null primary key, user_login text not null, display_name text not null, email text not null, user_type text, broadcaster_type text, user_description text, created_at text not null, category_id text, modified_at text, stream_language text not null default 'en', title text not null default '', delay int not null default 0, chat_color text not null default '#9146FF', foreign key (category_id) references categories(id) );
90
+
create table users( id text not null primary key, user_login text not null, display_name text not null, email text not null, user_type text, broadcaster_type text, user_description text, created_at text not null, category_id text, modified_at text, stream_language text not null default 'en', title text not null default '', delay int not null default 0, chat_color text not null default '#9146FF', branded_content boolean not null default false, content_labels text not null default '', foreign key (category_id) references categories(id) );
85
91
create table follows ( broadcaster_id text not null, user_id text not null, created_at text not null, primary key (broadcaster_id, user_id), foreign key (broadcaster_id) references users(id), foreign key (user_id) references users(id) );
86
92
create table blocks ( broadcaster_id text not null, user_id text not null, created_at text not null, primary key (broadcaster_id, user_id), foreign key (broadcaster_id) references users(id), foreign key (user_id) references users(id) );
87
93
create table bans ( broadcaster_id text not null, user_id text not null, created_at text not null, expires_at text, primary key (broadcaster_id, user_id), foreign key (broadcaster_id) references users(id), foreign key (user_id) references users(id) );
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+
// SPDX-License-Identifier: Apache-2.0
3
+
package models
4
+
5
+
typeContentClassificationLabelstruct {
6
+
Descriptionstring
7
+
IDstring
8
+
Namestring
9
+
RestrictedGamingbool// Restricts users from applying that CCL via the API. Currently only for MatureGame.
10
+
}
11
+
12
+
varCCL_MAP=map[string]ContentClassificationLabel{
13
+
"DrugsIntoxication": {
14
+
Description: "Excessive tobacco glorification or promotion, any marijuana consumption/use, legal drug and alcohol induced intoxication, discussions of illegal drugs.",
15
+
ID: "DrugsIntoxication",
16
+
Name: "Drugs, Intoxication, or Excessive Tobacco Use",
17
+
RestrictedGaming: false,
18
+
},
19
+
"Gambling": {
20
+
Description: "Participating in online or in-person gambling, poker or fantasy sports, that involve the exchange of real money.",
21
+
ID: "Gambling",
22
+
Name: "Gambling",
23
+
RestrictedGaming: false,
24
+
},
25
+
"MatureGame": {
26
+
Description: "Games that are rated Mature or less suitable for a younger audience.",
27
+
ID: "MatureGame",
28
+
Name: "Mature-rated game",
29
+
RestrictedGaming: true,
30
+
},
31
+
"ProfanityVulgarity": {
32
+
Description: "Prolonged, and repeated use of obscenities, profanities, and vulgarities, especially as a regular part of speech.",
33
+
ID: "ProfanityVulgarity",
34
+
Name: "Significant Profanity or Vulgarity",
35
+
RestrictedGaming: false,
36
+
},
37
+
"SexualThemes": {
38
+
Description: "Content that focuses on sexualized physical attributes and activities, sexual topics, or experiences.",
39
+
ID: "SexualThemes",
40
+
Name: "Sexual Themes",
41
+
RestrictedGaming: false,
42
+
},
43
+
"ViolentGraphic": {
44
+
Description: "Simulations and/or depictions of realistic violence, gore, extreme injury, or death.",
0 commit comments