diff --git a/.github/workflows/DemoToMainMigration.yml b/.github/workflows/DemoToMainMigration.yml
new file mode 100644
index 0000000..b688968
--- /dev/null
+++ b/.github/workflows/DemoToMainMigration.yml
@@ -0,0 +1,76 @@
+name: Sync Migrations from Demo to Main
+
+on:
+ pull_request:
+ branches:
+ - main # Se ejecuta cuando se crea un PR hacia la rama "main"
+ types:
+ - opened
+ - synchronize
+ - reopened
+
+permissions:
+ contents: write # Permiso para escribir en el repo
+
+jobs:
+ sync:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Obtener todo el historial para comparación
+
+ - name: Configure Git user
+ run: |
+ git config --global user.name "kravmaga95"
+ git config --global user.email "edwardsalex8034@gmail.com"
+
+ - name: Authenticate Git
+ run: |
+ git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
+
+ - name: Ensure demo branch is up-to-date
+ run: |
+ git fetch origin demo
+ git checkout demo || git checkout -b demo origin/demo
+ git pull --rebase origin demo || { echo "Error pulling demo branch"; exit 1; }
+
+ - name: Copy migration files from demo to temporary folder
+ run: |
+ # Verifica si la carpeta 'demo/migrations' existe y copia los archivos a una carpeta temporal fuera del repo
+ if [ -d "demo/migrations" ]; then
+ echo "Copying migration files from demo/migrations to temporary folder..."
+ mkdir -p /tmp/migrations # Carpeta temporal fuera del repositorio
+ cp demo/migrations/* /tmp/migrations/ # Copiar los archivos
+ else
+ echo "No migrations folder in demo, skipping copy."
+ exit 1
+ fi
+
+ - name: Checkout main branch
+ run: |
+ git fetch origin main
+ git checkout main || git checkout -b main origin/main
+ git pull --rebase origin main || { echo "Error pulling main branch"; exit 1; }
+
+ - name: Ensure prod/migrations folder exists in main
+ run: |
+ # Verifica si la carpeta prod/migrations existe en main, si no, la crea
+ if [ ! -d "prod/migrations" ]; then
+ mkdir -p prod/migrations # Crea la carpeta prod/migrations si no existe
+ echo "Created prod/migrations folder in main."
+ fi
+
+ - name: Copy migration files from temporary folder to prod/migrations
+ run: |
+ # Copia los archivos de la carpeta temporal a prod/migrations
+ echo "Copying migration files from temporary folder to prod/migrations..."
+ cp /tmp/migrations/* prod/migrations/
+
+ - name: Commit and push changes to main
+ run: |
+ git add prod/migrations/* # Agregar los archivos modificados
+ git commit -m "Sync migration files from demo to main"
+ git push origin main || { echo "Push failed"; exit 1; }
diff --git a/.github/workflows/migration.yml b/.github/workflows/migration.yml
new file mode 100644
index 0000000..d1339dd
--- /dev/null
+++ b/.github/workflows/migration.yml
@@ -0,0 +1,64 @@
+name: Sync Migrations from Test to Demo
+
+on:
+ push:
+ branches:
+ - test # Se ejecuta cuando hay un push en la rama "test"
+
+permissions:
+ contents: write # Permiso para escribir en el repo
+
+jobs:
+ sync:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Obtener todo el historial para comparación
+
+ - name: Configure Git user
+ run: |
+ git config --global user.name "kravmaga95"
+ git config --global user.email "edwardsalex8034@gmail.com"
+ - name: Authenticate Git
+ run: |
+ git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
+ - name: Ensure test branch is up-to-date
+ run: |
+ git checkout test
+ git pull --ff-only origin test || { echo "Error pulling test branch"; exit 1; }
+ - name: Copy migration files from test to temporary folder
+ run: |
+ # Verifica si la carpeta 'test/migrations' existe y copia los archivos a una carpeta temporal fuera del repo
+ if [ -d "test/migrations" ]; then
+ echo "Copying migration files from test/migrations to temporary folder..."
+ mkdir -p /tmp/migrations # Carpeta temporal fuera del repositorio
+ cp test/migrations/* /tmp/migrations/ # Copiar los archivos
+ else
+ echo "No migrations folder in test, skipping copy."
+ exit 1
+ fi
+ - name: Checkout demo branch
+ run: |
+ git fetch origin demo
+ git checkout demo || git checkout -b demo origin/demo
+ git pull --ff-only origin demo || { echo "Error pulling demo branch"; exit 1; }
+ - name: Ensure demo/migrations folder exists
+ run: |
+ # Verifica si la carpeta demo/migrations existe, si no, la crea
+ if [ ! -d "demo/migrations" ]; then
+ mkdir -p demo/migrations # Crea la carpeta demo/migrations si no existe
+ echo "Created migrations folder in demo."
+ fi
+ - name: Copy migration files from temporary folder to demo
+ run: |
+ # Copia los archivos de la carpeta temporal a demo/migrations
+ echo "Copying migration files from temporary folder to demo/migrations..."
+ cp /tmp/migrations/* demo/migrations/
+ - name: Commit and push changes to demo
+ run: |
+ git add demo/migrations/* # Agregar los archivos modificados
+ git commit -m "Sync migration files from test to demo"
+ git push origin demo || { echo "Push failed"; exit 1; }
diff --git a/demo/.gitignore b/demo/.gitignore
deleted file mode 100644
index 8755e7a..0000000
--- a/demo/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-
-# Flyway ignores
-*.user.toml
-*.artifact
-report.html
-report.json
\ No newline at end of file
diff --git a/demo/Filter.scpf b/demo/Filter.scpf
deleted file mode 100644
index 10bcf22..0000000
--- a/demo/Filter.scpf
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
- Filter
-
- False
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
-
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
-
- True
-
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
-
-
diff --git a/demo/flyway.toml b/demo/flyway.toml
deleted file mode 100644
index 19f658d..0000000
--- a/demo/flyway.toml
+++ /dev/null
@@ -1,120 +0,0 @@
-databaseType = "SqlServer"
-id = "dc11b21e-7756-4c3f-83f4-bc7e7a76bbec"
-name = "demo"
-
-[flyway]
-defaultSchema = "dbo"
-locations = [ "filesystem:migrations" ]
-mixed = true
-outOfOrder = true
-schemaModelLocation = "schema-model"
-validateMigrationNaming = true
-
- [flyway.check]
- majorTolerance = 0
-
-[flyway.sqlserver.clean]
-mode = "all"
-
-[flywayDesktop]
-developmentEnvironment = "development"
-shadowEnvironment = "shadow"
-
-[redgateCompare]
-filterFile = "filter.rgf"
-
- [redgateCompare.sqlserver]
- filterFile = "Filter.scpf"
-
-[redgateCompare.sqlserver.data.options.comparison]
-compressTemporaryFiles = false
-forceBinaryCollation = false
-treatEmptyStringAsNull = false
-trimTrailingWhiteSpace = false
-useChecksumComparison = false
-useMaxPrecisionForFloatComparison = false
-
-[redgateCompare.sqlserver.data.options.deployment]
-disableDdlTriggers = true
-disableDmlTriggers = false
-disableForeignKeys = false
-dontIncludeCommentsInScript = false
-dropPrimaryKeysIndexesAndUniqueConstraints = false
-reseedIdentityColumns = false
-skipIntegrityChecksForForeignKeys = false
-transportClrDataTypesAsBinary = false
-
-[redgateCompare.sqlserver.data.options.mapping]
-includeTimestampColumns = false
-useCaseSensitiveObjectDefinition = true
-
-[redgateCompare.sqlserver.options.behavior]
-addCreateOrAlterForRerunnableScripts = false
-addDropAndCreateForRerunnableScripts = false
-addNoPopulationToFulltextIndexes = false
-addObjectExistenceChecks = false
-addOnlineOnWhenCreatingIndexesOrAlteringColumns = false
-addWithEncryption = false
-considerNextFilegroupInPartitionSchemes = true
-decryptEncryptedObjects = true
-disableAutoColumnMapping = false
-dontUseAlterAssemblyToChangeClrObjects = false
-forbidDuplicateTableStorageSettings = false
-forceColumnOrder = false
-ignoreMigrationScripts = false
-includeDependencies = true
-includeRoleExistenceChecks = true
-includeSchemaExistenceChecks = true
-inlineFulltextFields = false
-inlineTableObjects = false
-useCaseSensitiveObjectDefinition = false
-useDatabaseCompatibilityLevel = false
-useSetStatementsInScriptDatabaseInfo = false
-writeAssembliesAsDlls = false
-
-[redgateCompare.sqlserver.options.ignores]
-ignoreAuthorizationOnSchemaObjects = false
-ignoreBindings = false
-ignoreChangeTracking = false
-ignoreCollations = true
-ignoreComments = false
-ignoreDataCompression = true
-ignoreDataSyncSchema = false
-ignoreDatabaseAndServerNameInSynonyms = true
-ignoreDmlTriggers = false
-ignoreDynamicDataMasking = false
-ignoreEventNotificationsOnQueues = false
-ignoreExtendedProperties = false
-ignoreFileGroupsPartitionSchemesAndPartitionFunctions = true
-ignoreFillFactorAndIndexPadding = true
-ignoreFullTextIndexing = false
-ignoreIdentitySeedAndIncrementValues = false
-ignoreIndexes = false
-ignoreInsteadOfTriggers = false
-ignoreInternallyUsedMicrosoftExtendedProperties = false
-ignoreLockPropertiesOfIndexes = false
-ignoreNocheckAndWithNocheck = false
-ignoreNotForReplication = true
-ignoreNullabilityOfColumns = false
-ignorePerformanceIndexes = false
-ignorePermissions = false
-ignoreReplicationTriggers = true
-ignoreSchemas = false
-ignoreSensitivityClassifications = false
-ignoreSetQuotedIdentifierAndSetAnsiNullsStatements = false
-ignoreSquareBracketsInObjectNames = false
-ignoreStatistics = true
-ignoreStatisticsIncremental = false
-ignoreStatisticsNoRecomputePropertyOnIndexes = false
-ignoreSynonymDependencies = false
-ignoreSystemNamedConstraintAndIndexNames = false
-ignoreTsqltFrameworkAndTests = true
-ignoreUserProperties = true
-ignoreUsersPermissionsAndRoleMemberships = true
-ignoreWhiteSpace = true
-ignoreWithElementOrder = true
-ignoreWithEncryption = false
-ignoreWithNoCheck = true
-
-[environments.demo]
-url = "jdbc:sqlserver://1IHTPORTHV4H\\DEMO;databaseName=prueba;encrypt=true;integratedSecurity=true;trustServerCertificate=true"
diff --git a/prod/.gitignore b/prod/.gitignore
deleted file mode 100644
index 8755e7a..0000000
--- a/prod/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-
-# Flyway ignores
-*.user.toml
-*.artifact
-report.html
-report.json
\ No newline at end of file
diff --git a/prod/Filter.scpf b/prod/Filter.scpf
deleted file mode 100644
index 10bcf22..0000000
--- a/prod/Filter.scpf
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
- Filter
-
- False
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
-
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
-
- True
-
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
- True
- TRUE
-
-
-
-
diff --git a/prod/flyway.toml b/prod/flyway.toml
deleted file mode 100644
index 8059a93..0000000
--- a/prod/flyway.toml
+++ /dev/null
@@ -1,120 +0,0 @@
-databaseType = "SqlServer"
-id = "cde08958-b952-4435-9ae2-aef98ebc29ac"
-name = "prod"
-
-[flyway]
-defaultSchema = "dbo"
-locations = [ "filesystem:migrations" ]
-mixed = true
-outOfOrder = true
-schemaModelLocation = "schema-model"
-validateMigrationNaming = true
-
- [flyway.check]
- majorTolerance = 0
-
-[flyway.sqlserver.clean]
-mode = "all"
-
-[flywayDesktop]
-developmentEnvironment = "development"
-shadowEnvironment = "shadow"
-
-[redgateCompare]
-filterFile = "filter.rgf"
-
- [redgateCompare.sqlserver]
- filterFile = "Filter.scpf"
-
-[redgateCompare.sqlserver.data.options.comparison]
-compressTemporaryFiles = false
-forceBinaryCollation = false
-treatEmptyStringAsNull = false
-trimTrailingWhiteSpace = false
-useChecksumComparison = false
-useMaxPrecisionForFloatComparison = false
-
-[redgateCompare.sqlserver.data.options.deployment]
-disableDdlTriggers = true
-disableDmlTriggers = false
-disableForeignKeys = false
-dontIncludeCommentsInScript = false
-dropPrimaryKeysIndexesAndUniqueConstraints = false
-reseedIdentityColumns = false
-skipIntegrityChecksForForeignKeys = false
-transportClrDataTypesAsBinary = false
-
-[redgateCompare.sqlserver.data.options.mapping]
-includeTimestampColumns = false
-useCaseSensitiveObjectDefinition = true
-
-[redgateCompare.sqlserver.options.behavior]
-addCreateOrAlterForRerunnableScripts = false
-addDropAndCreateForRerunnableScripts = false
-addNoPopulationToFulltextIndexes = false
-addObjectExistenceChecks = false
-addOnlineOnWhenCreatingIndexesOrAlteringColumns = false
-addWithEncryption = false
-considerNextFilegroupInPartitionSchemes = true
-decryptEncryptedObjects = true
-disableAutoColumnMapping = false
-dontUseAlterAssemblyToChangeClrObjects = false
-forbidDuplicateTableStorageSettings = false
-forceColumnOrder = false
-ignoreMigrationScripts = false
-includeDependencies = true
-includeRoleExistenceChecks = true
-includeSchemaExistenceChecks = true
-inlineFulltextFields = false
-inlineTableObjects = false
-useCaseSensitiveObjectDefinition = false
-useDatabaseCompatibilityLevel = false
-useSetStatementsInScriptDatabaseInfo = false
-writeAssembliesAsDlls = false
-
-[redgateCompare.sqlserver.options.ignores]
-ignoreAuthorizationOnSchemaObjects = false
-ignoreBindings = false
-ignoreChangeTracking = false
-ignoreCollations = true
-ignoreComments = false
-ignoreDataCompression = true
-ignoreDataSyncSchema = false
-ignoreDatabaseAndServerNameInSynonyms = true
-ignoreDmlTriggers = false
-ignoreDynamicDataMasking = false
-ignoreEventNotificationsOnQueues = false
-ignoreExtendedProperties = false
-ignoreFileGroupsPartitionSchemesAndPartitionFunctions = true
-ignoreFillFactorAndIndexPadding = true
-ignoreFullTextIndexing = false
-ignoreIdentitySeedAndIncrementValues = false
-ignoreIndexes = false
-ignoreInsteadOfTriggers = false
-ignoreInternallyUsedMicrosoftExtendedProperties = false
-ignoreLockPropertiesOfIndexes = false
-ignoreNocheckAndWithNocheck = false
-ignoreNotForReplication = true
-ignoreNullabilityOfColumns = false
-ignorePerformanceIndexes = false
-ignorePermissions = false
-ignoreReplicationTriggers = true
-ignoreSchemas = false
-ignoreSensitivityClassifications = false
-ignoreSetQuotedIdentifierAndSetAnsiNullsStatements = false
-ignoreSquareBracketsInObjectNames = false
-ignoreStatistics = true
-ignoreStatisticsIncremental = false
-ignoreStatisticsNoRecomputePropertyOnIndexes = false
-ignoreSynonymDependencies = false
-ignoreSystemNamedConstraintAndIndexNames = false
-ignoreTsqltFrameworkAndTests = true
-ignoreUserProperties = true
-ignoreUsersPermissionsAndRoleMemberships = true
-ignoreWhiteSpace = true
-ignoreWithElementOrder = true
-ignoreWithEncryption = false
-ignoreWithNoCheck = true
-
-[environments."1IHTPORTHV4H\\PROD"]
-url = "jdbc:sqlserver://1IHTPORTHV4H\\PROD;databaseName=prueba;encrypt=true;integratedSecurity=true;trustServerCertificate=true"
diff --git a/test/migrations/V1.1__Add_Description_To_Brand.sql b/test/migrations/V1.1__Add_Description_To_Brand.sql
deleted file mode 100644
index 8ebf07c..0000000
--- a/test/migrations/V1.1__Add_Description_To_Brand.sql
+++ /dev/null
@@ -1,2 +0,0 @@
-ALTER TABLE Brand
-ADD Description NVARCHAR(500) NULL;
\ No newline at end of file