Skip to content

Commit

Permalink
change of model locations
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Dec 18, 2023
1 parent 0c384e6 commit b49e91e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
42 changes: 1 addition & 41 deletions dockerManager/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from django.db import models
from loginSystem.models import Administrator
from websiteFunctions.website import Websites

# Create your models here.
class Containers(models.Model):
Expand All @@ -16,43 +15,4 @@ class Containers(models.Model):
ports = models.TextField(default="{}")
volumes = models.TextField(default="{}")
env = models.TextField(default="{}")
startOnReboot = models.IntegerField(default=0)

# Takes
# ComposePath, MySQLPath, MySQLRootPass, MySQLDBName, MySQLDBNUser, MySQLPassword, CPUsMySQL, MemoryMySQL,
# port, SitePath, CPUsSite, MemorySite, SiteName
# finalURL, blogTitle, adminUser, adminPassword, adminEmail

### Site Type 0=wp, further tbd later

class DockerSites(models.Model):
admin = models.ForeignKey(Websites, on_delete=models.CASCADE)
ComposePath = models.TextField()
SitePath = models.TextField()
MySQLPath = models.TextField()
state = models.IntegerField(default=1)
SiteType = models.IntegerField(default=0) ## WP, Joomla etc
MySQLDBName = models.CharField(max_length=100)
MySQLDBNUser = models.CharField(max_length=100)
CPUsMySQL = models.CharField(max_length=100)
MemoryMySQL = models.CharField(max_length=100)
port = models.CharField(max_length=100)
CPUsSite = models.CharField(max_length=100)
MemorySite = models.CharField(max_length=100)
SiteName = models.TextField()
finalURL = models.TextField()
blogTitle = models.TextField()
adminUser = models.CharField(max_length=100)
adminEmail = models.CharField(max_length=100)

class DockerPackages(models.Model):
CPUs = models.IntegerField()
Ram = models.IntegerField()
Bandwidth = models.TextField()
DiskSpace = models.TextField()
config = models.TextField()


class PackageAssignment(models.Model):
user = models.ForeignKey(Administrator, on_delete=models.CASCADE)
package = models.ForeignKey(DockerPackages, on_delete=models.CASCADE)
startOnReboot = models.IntegerField(default=0)
42 changes: 41 additions & 1 deletion websiteFunctions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,44 @@ class Backupsv2(models.Model):
class BackupsLogsv2(models.Model):
owner = models.ForeignKey(Backupsv2, on_delete=models.CASCADE)
timeStamp = models.CharField(max_length=255, default=str(time.time()))
message = models.TextField(default='')
message = models.TextField(default='')


# Takes
# ComposePath, MySQLPath, MySQLRootPass, MySQLDBName, MySQLDBNUser, MySQLPassword, CPUsMySQL, MemoryMySQL,
# port, SitePath, CPUsSite, MemorySite, SiteName
# finalURL, blogTitle, adminUser, adminPassword, adminEmail

### Site Type 0=wp, further tbd later

class DockerSites(models.Model):
admin = models.ForeignKey(Websites, on_delete=models.CASCADE)
ComposePath = models.TextField()
SitePath = models.TextField()
MySQLPath = models.TextField()
state = models.IntegerField(default=1)
SiteType = models.IntegerField(default=0) ## WP, Joomla etc
MySQLDBName = models.CharField(max_length=100)
MySQLDBNUser = models.CharField(max_length=100)
CPUsMySQL = models.CharField(max_length=100)
MemoryMySQL = models.CharField(max_length=100)
port = models.CharField(max_length=100)
CPUsSite = models.CharField(max_length=100)
MemorySite = models.CharField(max_length=100)
SiteName = models.TextField()
finalURL = models.TextField()
blogTitle = models.TextField()
adminUser = models.CharField(max_length=100)
adminEmail = models.CharField(max_length=100)

class DockerPackages(models.Model):
CPUs = models.IntegerField()
Ram = models.IntegerField()
Bandwidth = models.TextField()
DiskSpace = models.TextField()
config = models.TextField()


class PackageAssignment(models.Model):
user = models.ForeignKey(Administrator, on_delete=models.CASCADE)
package = models.ForeignKey(DockerPackages, on_delete=models.CASCADE)

0 comments on commit b49e91e

Please sign in to comment.