Revert "Removed erroneous null constraint on DB."

This reverts commit d910cbcc
pull/553/head
Louis Vézina 5 years ago
parent d910cbcc6c
commit 10e73994e6

@ -34,8 +34,8 @@ class BaseModel(Model):
class System(BaseModel): class System(BaseModel):
configured = TextField() configured = TextField(null=True)
updated = TextField() updated = TextField(null=True)
class Meta: class Meta:
table_name = 'system' table_name = 'system'
@ -43,41 +43,41 @@ class System(BaseModel):
class TableShows(BaseModel): class TableShows(BaseModel):
alternate_titles = TextField(column_name='alternateTitles') alternate_titles = TextField(column_name='alternateTitles', null=True)
audio_language = TextField() audio_language = TextField(null=True)
fanart = TextField() fanart = TextField(null=True)
forced = TextField() forced = TextField(null=True)
hearing_impaired = TextField() hearing_impaired = TextField(null=True)
languages = TextField() languages = TextField(null=True)
overview = TextField() overview = TextField(null=True)
path = TextField(unique=True) path = TextField(unique=True)
poster = TextField() poster = TextField(null=True)
sonarr_series_id = IntegerField(column_name='sonarrSeriesId', unique=True) sonarr_series_id = IntegerField(column_name='sonarrSeriesId', unique=True)
sort_title = TextField(column_name='sortTitle') sort_title = TextField(column_name='sortTitle', null=True)
title = TextField() title = TextField()
tvdb_id = AutoField(column_name='tvdbId') tvdb_id = AutoField(column_name='tvdbId')
year = TextField() year = TextField(null=True)
class Meta: class Meta:
table_name = 'table_shows' table_name = 'table_shows'
class TableEpisodes(BaseModel): class TableEpisodes(BaseModel):
audio_codec = TextField() audio_codec = TextField(null=True)
episode = IntegerField() episode = IntegerField()
failed_attempts = TextField(column_name='failedAttempts') failed_attempts = TextField(column_name='failedAttempts', null=True)
format = TextField() format = TextField(null=True)
missing_subtitles = TextField() missing_subtitles = TextField(null=True)
monitored = TextField() monitored = TextField(null=True)
path = TextField() path = TextField()
resolution = TextField() resolution = TextField(null=True)
scene_name = TextField() scene_name = TextField(null=True)
season = IntegerField() season = IntegerField()
sonarr_episode_id = IntegerField(column_name='sonarrEpisodeId', unique=True) sonarr_episode_id = IntegerField(column_name='sonarrEpisodeId', unique=True)
sonarr_series_id = ForeignKeyField(TableShows, field='sonarr_series_id', column_name='sonarrSeriesId') sonarr_series_id = ForeignKeyField(TableShows, field='sonarr_series_id', column_name='sonarrSeriesId')
subtitles = TextField() subtitles = TextField(null=True)
title = TextField() title = TextField()
video_codec = TextField() video_codec = TextField(null=True)
class Meta: class Meta:
table_name = 'table_episodes' table_name = 'table_episodes'
@ -85,30 +85,30 @@ class TableEpisodes(BaseModel):
class TableMovies(BaseModel): class TableMovies(BaseModel):
alternative_titles = TextField(column_name='alternativeTitles') alternative_titles = TextField(column_name='alternativeTitles', null=True)
audio_codec = TextField() audio_codec = TextField(null=True)
audio_language = TextField() audio_language = TextField(null=True)
failed_attempts = TextField(column_name='failedAttempts') failed_attempts = TextField(column_name='failedAttempts', null=True)
fanart = TextField() fanart = TextField(null=True)
forced = TextField() forced = TextField(null=True)
format = TextField() format = TextField(null=True)
hearing_impaired = TextField() hearing_impaired = TextField(null=True)
imdb_id = TextField(column_name='imdbId') imdb_id = TextField(column_name='imdbId', null=True)
languages = TextField() languages = TextField(null=True)
missing_subtitles = TextField() missing_subtitles = TextField(null=True)
monitored = TextField() monitored = TextField(null=True)
overview = TextField() overview = TextField(null=True)
path = TextField(unique=True) path = TextField(unique=True)
poster = TextField() poster = TextField(null=True)
radarr_id = IntegerField(column_name='radarrId', unique=True) radarr_id = IntegerField(column_name='radarrId', unique=True)
resolution = TextField() resolution = TextField(null=True)
scene_name = TextField(column_name='sceneName') scene_name = TextField(column_name='sceneName', null=True)
sort_title = TextField(column_name='sortTitle') sort_title = TextField(column_name='sortTitle', null=True)
subtitles = TextField() subtitles = TextField(null=True)
title = TextField() title = TextField()
tmdb_id = TextField(column_name='tmdbId', primary_key=True) tmdb_id = TextField(column_name='tmdbId', primary_key=True)
video_codec = TextField() video_codec = TextField(null=True)
year = TextField() year = TextField(null=True)
class Meta: class Meta:
table_name = 'table_movies' table_name = 'table_movies'
@ -118,13 +118,13 @@ class TableHistory(BaseModel):
id = IntegerField(null=False) id = IntegerField(null=False)
action = IntegerField() action = IntegerField()
description = TextField() description = TextField()
language = TextField(null=False) language = TextField(null=True)
provider = TextField(null=False) provider = TextField(null=True)
score = TextField(null=False) score = TextField(null=True)
sonarr_episode_id = ForeignKeyField(TableEpisodes, field='sonarr_episode_id', column_name='sonarrEpisodeId') sonarr_episode_id = ForeignKeyField(TableEpisodes, field='sonarr_episode_id', column_name='sonarrEpisodeId')
sonarr_series_id = ForeignKeyField(TableShows, field='sonarr_series_id', column_name='sonarrSeriesId') sonarr_series_id = ForeignKeyField(TableShows, field='sonarr_series_id', column_name='sonarrSeriesId')
timestamp = IntegerField() timestamp = IntegerField()
video_path = TextField(null=False) video_path = TextField(null=True)
class Meta: class Meta:
table_name = 'table_history' table_name = 'table_history'
@ -135,12 +135,12 @@ class TableHistoryMovie(BaseModel):
id = IntegerField(null=False) id = IntegerField(null=False)
action = IntegerField() action = IntegerField()
description = TextField() description = TextField()
language = TextField(null=False) language = TextField(null=True)
provider = TextField(null=False) provider = TextField(null=True)
radarr_id = ForeignKeyField(TableMovies, field='radarr_id', column_name='radarrId') radarr_id = ForeignKeyField(TableMovies, field='radarr_id', column_name='radarrId')
score = TextField(null=False) score = TextField(null=True)
timestamp = IntegerField() timestamp = IntegerField()
video_path = TextField(null=False) video_path = TextField(null=True)
class Meta: class Meta:
table_name = 'table_history_movie' table_name = 'table_history_movie'
@ -148,10 +148,10 @@ class TableHistoryMovie(BaseModel):
class TableSettingsLanguages(BaseModel): class TableSettingsLanguages(BaseModel):
code2 = TextField() code2 = TextField(null=True)
code3 = TextField(primary_key=True) code3 = TextField(primary_key=True)
code3b = TextField() code3b = TextField(null=True)
enabled = IntegerField() enabled = IntegerField(null=True)
name = TextField() name = TextField()
class Meta: class Meta:
@ -159,9 +159,9 @@ class TableSettingsLanguages(BaseModel):
class TableSettingsNotifier(BaseModel): class TableSettingsNotifier(BaseModel):
enabled = IntegerField() enabled = IntegerField(null=True)
name = TextField(primary_key=True) name = TextField(null=True, primary_key=True)
url = TextField() url = TextField(null=True)
class Meta: class Meta:
table_name = 'table_settings_notifier' table_name = 'table_settings_notifier'

Loading…
Cancel
Save