('email', models.EmailField(max_length=75)),
('token', models.CharField(max_length=100)),
('sentat', models.DateTimeField(auto_now=True)),
- ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)),
+ ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
],
),
]
cryptkey = models.CharField(max_length=100, null=False, blank=False,
help_text="Use tools/communityauth/generate_cryptkey.py to create a key")
comment = models.TextField(null=False, blank=True)
- org = models.ForeignKey(CommunityAuthOrg, null=False, blank=False)
+ org = models.ForeignKey(CommunityAuthOrg, null=False, blank=False, on_delete=models.CASCADE)
cooloff_hours = models.IntegerField(null=False, blank=False, default=0,
help_text="Number of hours a user must have existed in the systems before allowed to log in to this site")
class CommunityAuthConsent(models.Model):
- user = models.ForeignKey(User, null=False, blank=False)
- org = models.ForeignKey(CommunityAuthOrg, null=False, blank=False)
+ user = models.ForeignKey(User, null=False, blank=False, on_delete=models.CASCADE)
+ org = models.ForeignKey(CommunityAuthOrg, null=False, blank=False, on_delete=models.CASCADE)
consentgiven = models.DateTimeField(null=False, blank=False)
class Meta:
class EmailChangeToken(models.Model):
- user = models.OneToOneField(User, null=False, blank=False)
+ user = models.OneToOneField(User, null=False, blank=False, on_delete=models.CASCADE)
email = models.EmailField(max_length=75, null=False, blank=False)
token = models.CharField(max_length=100, null=False, blank=False)
sentat = models.DateTimeField(null=False, blank=False, auto_now=True)
migrations.AddField(
model_name='contributor',
name='ctype',
- field=models.ForeignKey(to='contributors.ContributorType'),
+ field=models.ForeignKey(to='contributors.ContributorType', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='contributor',
name='user',
- field=models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True),
+ field=models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE),
),
]
class Contributor(models.Model):
- ctype = models.ForeignKey(ContributorType)
+ ctype = models.ForeignKey(ContributorType, on_delete=models.CASCADE)
lastname = models.CharField(max_length=100, null=False, blank=False)
firstname = models.CharField(max_length=100, null=False, blank=False)
email = models.EmailField(null=False, blank=True)
companyurl = models.URLField(max_length=100, null=True, blank=True, verbose_name='Company URL')
location = models.CharField(max_length=100, null=True, blank=True)
contribution = models.TextField(null=True, blank=True)
- user = models.ForeignKey(User, null=True, blank=True)
+ user = models.ForeignKey(User, null=True, blank=True, on_delete=models.CASCADE)
send_notification = True
purge_urls = ('/community/contributors/', )
('title', models.CharField(max_length=100)),
('url', models.URLField()),
('posttime', models.DateTimeField()),
- ('feed', models.ForeignKey(to='core.ImportedRSSFeed')),
+ ('feed', models.ForeignKey(to='core.ImportedRSSFeed', on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
migrations.CreateModel(
name='UserProfile',
fields=[
- ('user', models.OneToOneField(primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
+ ('user', models.OneToOneField(primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
('sshkey', models.TextField(help_text='Paste one or more public keys in OpenSSH format, one per line.', verbose_name='SSH key', blank=True, validators=[pgweb.core.models.validate_sshkey])),
('lastmodified', models.DateTimeField(auto_now=True)),
],
migrations.AddField(
model_name='organisation',
name='orgtype',
- field=models.ForeignKey(verbose_name='Organisation type', to='core.OrganisationType'),
+ field=models.ForeignKey(verbose_name='Organisation type', to='core.OrganisationType', on_delete=models.CASCADE),
),
]
url = models.URLField(null=False, blank=False)
email = models.EmailField(null=False, blank=True)
phone = models.CharField(max_length=100, null=False, blank=True)
- orgtype = models.ForeignKey(OrganisationType, null=False, blank=False, verbose_name="Organisation type")
+ orgtype = models.ForeignKey(OrganisationType, null=False, blank=False, verbose_name="Organisation type", on_delete=models.CASCADE)
managers = models.ManyToManyField(User, blank=False)
lastconfirmed = models.DateTimeField(null=False, blank=False, auto_now_add=True)
class ImportedRSSItem(models.Model):
- feed = models.ForeignKey(ImportedRSSFeed)
+ feed = models.ForeignKey(ImportedRSSFeed, on_delete=models.CASCADE)
title = models.CharField(max_length=100, null=False, blank=False)
url = models.URLField(null=False, blank=False)
posttime = models.DateTimeField(null=False, blank=False)
# Extra attributes for users (if they have them)
class UserProfile(models.Model):
- user = models.OneToOneField(User, null=False, blank=False, primary_key=True)
+ user = models.OneToOneField(User, null=False, blank=False, primary_key=True, on_delete=models.CASCADE)
sshkey = models.TextField(null=False, blank=True, verbose_name="SSH key", help_text="Paste one or more public keys in OpenSSH format, one per line.", validators=[validate_sshkey, ])
lastmodified = models.DateTimeField(null=False, blank=False, auto_now=True)
block_oauth = models.BooleanField(null=False, blank=False, default=False,
('comment', models.TextField()),
('posted_at', models.DateTimeField(auto_now_add=True)),
('approved', models.BooleanField(default=False)),
- ('submitter', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
+ ('submitter', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
],
options={
'ordering': ('-posted_at',),
('file', models.CharField(max_length=64)),
('title', models.CharField(max_length=256, null=True, blank=True)),
('content', models.TextField(null=True, blank=True)),
- ('version', models.ForeignKey(to='core.Version', db_column='version', to_field='tree')),
+ ('version', models.ForeignKey(to='core.Version', db_column='version', to_field='tree', on_delete=models.CASCADE)),
],
options={
'db_table': 'docs',
class DocPage(models.Model):
id = models.AutoField(null=False, primary_key=True)
file = models.CharField(max_length=64, null=False, blank=False)
- version = models.ForeignKey(Version, null=False, blank=False, db_column='version', to_field='tree')
+ version = models.ForeignKey(Version, null=False, blank=False, db_column='version', to_field='tree', on_delete=models.CASCADE)
title = models.CharField(max_length=256, null=True, blank=True)
content = models.TextField(null=True, blank=True)
('description', models.TextField()),
('price', models.CharField(max_length=200, blank=True)),
('lastconfirmed', models.DateTimeField(auto_now_add=True)),
- ('category', models.ForeignKey(to='downloads.Category')),
- ('licencetype', models.ForeignKey(verbose_name='Licence type', to='downloads.LicenceType')),
- ('org', models.ForeignKey(db_column='publisher_id', verbose_name='Organisation', to='core.Organisation')),
+ ('category', models.ForeignKey(to='downloads.Category', on_delete=models.CASCADE)),
+ ('licencetype', models.ForeignKey(verbose_name='Licence type', to='downloads.LicenceType', on_delete=models.CASCADE)),
+ ('org', models.ForeignKey(db_column='publisher_id', verbose_name='Organisation', to='core.Organisation', on_delete=models.CASCADE)),
],
options={
'ordering': ('name',),
class Product(models.Model):
name = models.CharField(max_length=100, null=False, blank=False, unique=True)
approved = models.BooleanField(null=False, default=False)
- org = models.ForeignKey(Organisation, db_column="publisher_id", null=False, verbose_name="Organisation")
+ org = models.ForeignKey(Organisation, db_column="publisher_id", null=False, verbose_name="Organisation", on_delete=models.CASCADE)
url = models.URLField(null=False, blank=False)
- category = models.ForeignKey(Category, null=False)
- licencetype = models.ForeignKey(LicenceType, null=False, verbose_name="Licence type")
+ category = models.ForeignKey(Category, null=False, on_delete=models.CASCADE)
+ licencetype = models.ForeignKey(LicenceType, null=False, verbose_name="Licence type", on_delete=models.CASCADE)
description = models.TextField(null=False, blank=False)
price = models.CharField(max_length=200, null=False, blank=True)
lastconfirmed = models.DateTimeField(null=False, blank=False, auto_now_add=True)
('enddate', models.DateField(verbose_name='End date')),
('summary', models.TextField(help_text='A short introduction (shown on the events listing page)')),
('details', models.TextField(help_text='Complete event description')),
- ('country', models.ForeignKey(blank=True, to='core.Country', null=True)),
- ('language', models.ForeignKey(default='eng', blank=True, to='core.Language', help_text='Primary language for event. When multiple languages, specify this in the event description', null=True)),
- ('org', models.ForeignKey(verbose_name='Organisation', to='core.Organisation', help_text='If no organisations are listed, please check the <a href="/account/orglist/">organisation list</a> and contact the organisation manager or <a href="mailto:webmaster@postgresql.org">webmaster@postgresql.org</a> if none are listed.')),
+ ('country', models.ForeignKey(blank=True, to='core.Country', null=True, on_delete=models.CASCADE)),
+ ('language', models.ForeignKey(default='eng', blank=True, to='core.Language', help_text='Primary language for event. When multiple languages, specify this in the event description', null=True, on_delete=models.CASCADE)),
+ ('org', models.ForeignKey(verbose_name='Organisation', to='core.Organisation', help_text='If no organisations are listed, please check the <a href="/account/orglist/">organisation list</a> and contact the organisation manager or <a href="mailto:webmaster@postgresql.org">webmaster@postgresql.org</a> if none are listed.', on_delete=models.CASCADE)),
],
options={
'ordering': ('-startdate', '-enddate'),
class Event(models.Model):
approved = models.BooleanField(null=False, blank=False, default=False)
- org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text="If no organisations are listed, please check the <a href=\"/account/orglist/\">organisation list</a> and contact the organisation manager or <a href=\"mailto:webmaster@postgresql.org\">webmaster@postgresql.org</a> if none are listed.")
+ org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text="If no organisations are listed, please check the <a href=\"/account/orglist/\">organisation list</a> and contact the organisation manager or <a href=\"mailto:webmaster@postgresql.org\">webmaster@postgresql.org</a> if none are listed.", on_delete=models.CASCADE)
title = models.CharField(max_length=100, null=False, blank=False)
isonline = models.BooleanField(null=False, default=False, verbose_name="Online event")
city = models.CharField(max_length=50, null=False, blank=True)
state = models.CharField(max_length=50, null=False, blank=True)
- country = models.ForeignKey(Country, null=True, blank=True)
- language = models.ForeignKey(Language, null=True, blank=True, default='eng', help_text="Primary language for event. When multiple languages, specify this in the event description")
+ country = models.ForeignKey(Country, null=True, blank=True, on_delete=models.CASCADE)
+ language = models.ForeignKey(Language, null=True, blank=True, default='eng', help_text="Primary language for event. When multiple languages, specify this in the event description", on_delete=models.CASCADE)
badged = models.BooleanField(null=False, blank=False, default=False, verbose_name='Community event', help_text='Choose "Community event" if this is a community recognized event following the <a href="/community/recognition/#conferences" target="_blank">community event guidelines</a>.')
description_for_badged = models.TextField(blank=True, null=True, verbose_name='Description for community event', help_text='DEPRECRATED: This was used in the beginning of community events to collect additional information.')
migrations.AddField(
model_name='feature',
name='group',
- field=models.ForeignKey(to='featurematrix.FeatureGroup'),
+ field=models.ForeignKey(to='featurematrix.FeatureGroup', on_delete=models.CASCADE),
),
]
class Feature(models.Model):
- group = models.ForeignKey(FeatureGroup, null=False, blank=False)
+ group = models.ForeignKey(FeatureGroup, null=False, blank=False, on_delete=models.CASCADE)
featurename = models.CharField(max_length=100, null=False, blank=False)
featuredescription = models.TextField(null=False, blank=True)
# WARNING! All fields that start with "v" will be considered versions!
migrations.AddField(
model_name='mailinglist',
name='group',
- field=models.ForeignKey(to='lists.MailingListGroup'),
+ field=models.ForeignKey(to='lists.MailingListGroup', on_delete=models.CASCADE),
),
]
class MailingList(models.Model):
- group = models.ForeignKey(MailingListGroup, null=False)
+ group = models.ForeignKey(MailingListGroup, null=False, on_delete=models.CASCADE)
listname = models.CharField(max_length=64, null=False, blank=False, unique=True)
active = models.BooleanField(null=False, default=False)
description = models.TextField(null=False, blank=True)
('date', models.DateField(default=datetime.date.today)),
('title', models.CharField(max_length=200)),
('content', models.TextField()),
- ('org', models.ForeignKey(verbose_name='Organisation', to='core.Organisation', help_text='If no organisations are listed, please check the <a href="/account/orglist/">organisation list</a> and contact the organisation manager or <a href="mailto:webmaster@postgresql.org">webmaster@postgresql.org</a> if none are listed.')),
+ ('org', models.ForeignKey(verbose_name='Organisation', to='core.Organisation', help_text='If no organisations are listed, please check the <a href="/account/orglist/">organisation list</a> and contact the organisation manager or <a href="mailto:webmaster@postgresql.org">webmaster@postgresql.org</a> if none are listed.', on_delete=models.CASCADE)),
],
options={
'ordering': ('-date',),
class NewsArticle(models.Model):
- org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text="If no organisations are listed, please check the <a href=\"/account/orglist/\">organisation list</a> and contact the organisation manager or <a href=\"mailto:webmaster@postgresql.org\">webmaster@postgresql.org</a> if none are listed.")
+ org = models.ForeignKey(Organisation, null=False, blank=False, verbose_name="Organisation", help_text="If no organisations are listed, please check the <a href=\"/account/orglist/\">organisation list</a> and contact the organisation manager or <a href=\"mailto:webmaster@postgresql.org\">webmaster@postgresql.org</a> if none are listed.", on_delete=models.CASCADE)
approved = models.BooleanField(null=False, blank=False, default=False)
date = models.DateField(null=False, blank=False, default=date.today)
title = models.CharField(max_length=200, null=False, blank=False)
('provides_support', models.BooleanField(default=False)),
('provides_hosting', models.BooleanField(default=False)),
('interfaces', models.CharField(max_length=512, null=True, verbose_name='Interfaces (for hosting)', blank=True)),
- ('org', models.OneToOneField(db_column='organisation_id', to='core.Organisation', help_text='If no organisations are listed, please check the <a href="/account/orglist/">organisation list</a> and contact the organisation manager or <a href="mailto:webmaster@postgresql.org">webmaster@postgresql.org</a> if none are listed.', verbose_name='organisation')),
+ ('org', models.OneToOneField(db_column='organisation_id', to='core.Organisation', help_text='If no organisations are listed, please check the <a href="/account/orglist/">organisation list</a> and contact the organisation manager or <a href="mailto:webmaster@postgresql.org">webmaster@postgresql.org</a> if none are listed.', verbose_name='organisation', on_delete=models.CASCADE)),
],
options={
'ordering': ('org__name',),
approved = models.BooleanField(null=False, blank=False, default=False)
org = models.OneToOneField(Organisation, null=False, blank=False,
- db_column="organisation_id",
+ db_column="organisation_id", on_delete=models.CASCADE,
verbose_name="organisation",
help_text="If no organisations are listed, please check the <a href=\"/account/orglist/\">organisation list</a> and contact the organisation manager or <a href=\"mailto:webmaster@postgresql.org\">webmaster@postgresql.org</a> if none are listed.")
description = models.TextField(null=False, blank=False)
('title', models.CharField(help_text="Title/Name of the PUG, e.g. 'NYC PostgreSQL User Group'", max_length=255)),
('website_url', models.TextField(null=True, blank=True)),
('mailing_list_url', models.TextField(null=True, blank=True)),
- ('country', models.ForeignKey(to='core.Country')),
- ('org', models.ForeignKey(blank=True, to='core.Organisation', help_text='Organisation that manages the PUG and its contents', null=True)),
+ ('country', models.ForeignKey(to='core.Country', on_delete=models.CASCADE)),
+ ('org', models.ForeignKey(blank=True, to='core.Organisation', help_text='Organisation that manages the PUG and its contents', null=True, on_delete=models.CASCADE)),
],
),
]
"""
contains information about a local PostgreSQL user group
"""
- country = models.ForeignKey('core.Country')
- org = models.ForeignKey('core.Organisation', null=True, blank=True, help_text='Organisation that manages the PUG and its contents')
+ country = models.ForeignKey('core.Country', on_delete=models.CASCADE)
+ org = models.ForeignKey('core.Organisation', null=True, blank=True, help_text='Organisation that manages the PUG and its contents', on_delete=models.CASCADE)
approved = models.BooleanField(null=False, blank=False, default=False)
locale = models.CharField(max_length=255, help_text="Locale where the PUG meets, e.g. 'New York City'")
title = models.CharField(max_length=255, help_text="Title/Name of the PUG, e.g. 'NYC PostgreSQL User Group'")
('vector_i', models.CharField(blank=True, max_length=1, verbose_name='Integrity Impact', choices=[('H', 'High'), ('L', 'Low'), ('N', 'None')])),
('vector_a', models.CharField(blank=True, max_length=1, verbose_name='Availability Impact', choices=[('H', 'High'), ('L', 'Low'), ('N', 'None')])),
('legacyscore', models.CharField(blank=True, max_length=1, verbose_name='Legacy score', choices=[('A', 'A'), ('B', 'B'), ('C', 'C'), ('D', 'D')])),
- ('newspost', models.ForeignKey(blank=True, to='news.NewsArticle', null=True)),
+ ('newspost', models.ForeignKey(blank=True, to='news.NewsArticle', null=True, on_delete=models.CASCADE)),
],
options={
'ordering': ('-cvenumber',),
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('fixed_minor', models.IntegerField()),
- ('patch', models.ForeignKey(to='security.SecurityPatch')),
- ('version', models.ForeignKey(to='core.Version')),
+ ('patch', models.ForeignKey(to='security.SecurityPatch', on_delete=models.CASCADE)),
+ ('version', models.ForeignKey(to='core.Version', on_delete=models.CASCADE)),
],
),
migrations.AddField(
class SecurityPatch(models.Model):
public = models.BooleanField(null=False, blank=False, default=False)
- newspost = models.ForeignKey(NewsArticle, null=True, blank=True)
+ newspost = models.ForeignKey(NewsArticle, null=True, blank=True, on_delete=models.CASCADE)
cve = models.CharField(max_length=32, null=False, blank=True, validators=[cve_validator, ])
cve_visible = models.BooleanField(null=False, blank=False, default=False)
cvenumber = models.IntegerField(null=False, blank=False, db_index=True)
class SecurityPatchVersion(models.Model):
- patch = models.ForeignKey(SecurityPatch, null=False, blank=False)
- version = models.ForeignKey(Version, null=False, blank=False)
+ patch = models.ForeignKey(SecurityPatch, null=False, blank=False, on_delete=models.CASCADE)
+ version = models.ForeignKey(Version, null=False, blank=False, on_delete=models.CASCADE)
fixed_minor = models.IntegerField(null=False, blank=False)
('name', models.CharField(max_length=128)),
('url', models.URLField()),
('logoname', models.CharField(max_length=64)),
- ('country', models.ForeignKey(to='core.Country')),
+ ('country', models.ForeignKey(to='core.Country', on_delete=models.CASCADE)),
],
options={
'ordering': ('name',),
migrations.AddField(
model_name='sponsor',
name='sponsortype',
- field=models.ForeignKey(to='sponsors.SponsorType'),
+ field=models.ForeignKey(to='sponsors.SponsorType', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='server',
class Sponsor(models.Model):
- sponsortype = models.ForeignKey(SponsorType, null=False)
+ sponsortype = models.ForeignKey(SponsorType, null=False, on_delete=models.CASCADE)
name = models.CharField(max_length=128, null=False, blank=False)
url = models.URLField(null=False, blank=False)
logoname = models.CharField(max_length=64, null=False, blank=False)
- country = models.ForeignKey(Country, null=False)
+ country = models.ForeignKey(Country, null=False, on_delete=models.CASCADE)
purge_urls = ('/about/sponsors/', '/about/servers/', )
migrations.CreateModel(
name='SurveyAnswer',
fields=[
- ('survey', models.OneToOneField(primary_key=True, serialize=False, to='survey.Survey')),
+ ('survey', models.OneToOneField(primary_key=True, serialize=False, to='survey.Survey', on_delete=models.CASCADE)),
('tot1', models.IntegerField(default=0)),
('tot2', models.IntegerField(default=0)),
('tot3', models.IntegerField(default=0)),
class SurveyAnswer(models.Model):
- survey = models.OneToOneField(Survey, null=False, blank=False, primary_key=True)
+ survey = models.OneToOneField(Survey, null=False, blank=False, primary_key=True, on_delete=models.CASCADE)
tot1 = models.IntegerField(null=False, default=0)
tot2 = models.IntegerField(null=False, default=0)
tot3 = models.IntegerField(null=False, default=0)