Thursday, June 22, 2023

Re: Can any one help me with this question

Thank you for your reply. 

Annadatha. 

On Thu, Jun 22, 2023, 10:45 PM Praveen Chaudhary <prabinchy1234@gmail.com> wrote:
Hi Annadatha,

I'm glad to hear that upgrading to Oracle 21c worked for you. As for your question about working without migrations in Django, it's certainly possible but it's important to understand the implication and trade-offs.

Django migrations provide a way to manage and apply changes to your database schema over time, allowing for version control and easy deployment of database changes. They help maintain data integrity and make it easier to collaborate with other developers.

However, if you prefer not to use migrations, you can disable them in django by setting the 'MIGRATIIN_MODULES' setting to an empty dictionary in your projects settings.py file:

 MIGRATION_MODULES = {}


By doing this, you'll essentially disable the migration framework, and Django won't generate or apply migrations. Instead, you'll need to manually manage your database schema changes, which can be more error-prone and less convenient, especially in collaborative projects.

Keep in mind the following considerations if you decide to work without migrations:

1. Database schema management: You'll need to manually create, modify, and delete database tables, columns, and other schema elements as needed. This requires careful coordination and communication between developers working on the project.

2. Data integrity: Migrations help ensure data integrity during schema changes by providing a way to define and execute data transformations. Without migrations, you'll need to handle data migrations and transformations manually, which can be challenging and error-prone.

3. Deployment and version control: Migrations provide a structured way to apply schema changes to your database during deployment. Without migrations, you'll need to find alternative approaches for managing database changes in different environments and version controlling those changes.

Ultimately, the decision to use or not use migrations depends on your specific requirements, project complexity, and team collaboration. If you're working on a small, personal project with a simple schema and limited changes, managing the database schema manually might be feasible. However, for larger projects or teams, migrations can provide significant benefits in terms of maintainability, collaboration, and data integrity.

I hope this helps you make an informed decision. Let me know if you have any further questions!

Best regards
Prabin Chaudhary
+977-9840193890
Software Engineer | Youth Innovation Lab

On Thu, 22 Jun 2023, 7:55 pm Annadatha Rao, <annadatha.rao@gmail.com> wrote:
Hi  Prabin,

Thank you, it worked when I upgraded db to 21c (oracle), thank you for your help. Small question, can I work without migrations, some have I hate migrations being a legacy programmer from (Cobol days). I value your opinion.

Thank you,
ANNADATHA.

On Sun, Jun 18, 2023 at 9:19 PM Praveen Chaudhary <prabinchy1234@gmail.com> wrote:

Yes, Django migrations can work with Oracle 11.2 using the python-oracle database driver. However, it's important to note that the python-oracle package is not an official Oracle-provided driver. The official driver is called cx_Oracle, which is widely used for connecting Django to Oracle databases.

Here's an example of how Django migrations can work with Oracle 11.2 using cx_Oracle:

1. Install the cx_Oracle package using pip:
     pip install cx_Oracle
2.Update your Django project's settings.py file to include the Oracle database configuration:
     DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.oracle',
        'NAME': 'your_database_name',
        'USER': 'your_username',
        'PASSWORD': 'your_password',
        'HOST': 'your_host',
        'PORT': 'your_port',
    }
}

Replace the 'your_database_name', 'your_username', 'your_password', 'your_host', and 'your_port' with the appropriate values for your Oracle database.

3.Define your Django models in the models.py file.
4.Generate and apply the migrations using Django's makemigrations and migrate commands:

These commands will generate the necessary SQL statements based on your models and apply them to the Oracle database.

Please note that the example assumes you have already set up Oracle 11.2 and have the necessary Oracle client software installed on your machine.

It's also important to ensure that your version of Django is compatible with Oracle 11.2. Refer to the Django documentation and the documentation of the cx_Oracle package for any specific requirements or considerations when working with Oracle databases.

Remember to replace 'your_database_name', 'your_username', 'your_password', 'your_host', and 'your_port' with the appropriate values for your Oracle database configuration.

Prabin Chaudhary
+977-9840193890
Software Engineer | Youth Innovation Lab


On Sun, 18 Jun 2023 at 21:15, Annadatha Rao <annadatha.rao@gmail.com> wrote:
Dear All,

Do DJANGO migrations work with Oracle 11.2 with python-oracle db driver, please show me an example if works.

Thank you for your support,
Annadatha.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFtPNJw9wQgAo2jCFEs6undCf9FZ_oqww9kZWKLLaJAMGyoNaA%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAN9B8Z3itg0bvV8wzoNoAkJiF9FVZ%3DAP2Z2aLxRreYxVVki1_w%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFtPNJwWEh%2BrqVMLemRdMi0__UGp2ZJg-%2B6Ee2K-U%2B8VJvgKcw%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAN9B8Z1-keenYxaAzefuLu6QKurEOfvRL0cebONegMmJMMDOFA%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFtPNJx2Jj7xhhy%2BbYHJGqDoOFrmNgvzfSBUZ%3DTFb23h_H6zOQ%40mail.gmail.com.

No comments:

Post a Comment