Status: Discontinued
Rockin was a Django-based project designed to manage data of cores extracted from wells, including core catchers, core chips, cuttings, and micro-chips. Initially intended to develop a full-stack application for geologists and drilling engineers, the project has been scaled down due to time limitations. The final outcome includes a Django ORM-based data model for a MySQL database and scripts to migrate data from Microsoft Access to MySQL. An intermediate solution allows using Microsoft Access as a frontend client connected to a remote MySQL database.
Django ORM-based Data Model:
Data Migration Scripts:
Intermediate Solution: Reusing Microsft Access as a frontend:
Create a .env
file at the root of your repository based on the .env-example
file provided. This file should contain your environment-specific configurations, such as database credentials and application settings. Simply copy .env-example
to .env
and update the values accordingly.
To build and run the server using Docker, execute:
sudo docker-compose up -d --build
To run the database in a Docker container, you need to apply the migrations first. This is specified in the docker-compose.yaml
file at line 24. The application itself does not need to be run for the database to be functional.
To apply migrations and set up the database, follow these steps:
docker-compose.yaml
file.docker-compose up -d --build
You can access interactive the container running the database to make sure the migrations are applied correctly.
Access the Application Container:
docker ps
Access the container's shell:
docker exec -it <db_container_name> mysql -u root -p
Run Migrations if not applied when running docker-compose: Identify the running application container:
docker ps
docker exec -it <app_container_name> bash
python manage.py makemigrations
python manage.py migrate
To load data exported from Microsoft Access as csv files to MySQL, follow the detailed procedure in the crudapp/mannagement/commands
directory. Ensure all prerequisites are met and follow the instructions step by step. In order for csv table to be migrated first columns need to be renamed and checked to match the django ORM requirements in the model.
There is plenty of documentation in the scripts to guide you through the process.
This command will import data from a CSV file into the targeted database. The command requires the path to the CSV file, the model name, and the path to the mappings file.
python manage.py import_data path/to/csv.csv ModelName path/to/mappings.yaml
To connect your Microsoft Access application to an external MySQL database hosted on a server:
Install MySQL ODBC Driver:
Set Up System DSN:
Link Tables in Access:
For detailed steps, refer to the documentation in the docs
directory.
This setup allows you to run the database locally or on a server, enabling continued use of the application if someone decides to reactivate the project.
Although the full-stack application was not completed, the following components are reusable for future development:
Django Data Model:
Data Migration Documentation:
Access-MySQL Connection Guide:
By leveraging these components, future developers can build upon the existing work to create a comprehensive solution for managing well core data.