I use RDS. The db have different schemas for Users and Products
class Product(models.Model): id = models.AutoField(primary_key=True)
class User(models.Model): id = models.AutoField(primary_key=True)
DATABASES = {"default": {"ENGINE": "django.db.backends.postgresql","OPTIONS": {"options": "-c search_path=public"},"NAME": config("DB_NAME", default=""),"USER": config("DB_USER_NAME", default=""),"PASSWORD": config("DB_PASSWORD", default=""),"HOST": config("DB_HOST", default="db"),"PORT": config("DB_PORT", default=""), },"data": {"ENGINE": "django.db.backends.postgresql","OPTIONS": {"options": "-c search_path=products"},"NAME": config("DB_NAME", default=""),"USER": config("DB_USER_NAME", default=""),"PASSWORD": config("DB_PASSWORD", default=""),"HOST": config("DB_HOST", default="db"),"PORT": config("DB_PORT", default=""), },}
Can I create relation between this two tables from different db schemas?Or only one decision move Product table to default db?