Skip to content
Snippets Groups Projects
Select Git revision
  • dev protected
  • master default protected
  • gitkeep
  • Issue/2446-responsibleOrganizations
  • Issue/2309-docs
  • Issue/2355-topLevelOrg
  • Issue/2412-gitlabDuplicatesinProjectQuotas
  • Issue/2287-guestRole
  • Issue/2364-testingKpiParser
  • Issue/2102-gitLabResTypeRCV
  • Issue/2278-gitlabToS
  • Issue/2284-dbLogIndex
  • Issue/5678-addingGuestRoleToRoles
  • Issue/2265-UpdatingS3EndpointUDE
  • Issue/XXXX-testingMigrationsTimestamp
  • Issue/2101-gitLabResTypeUi
  • Issue/1788-extractionCronjob
  • Issue/2222-resourceDateCreated
  • Issue/2221-projectDateCreated
  • Issue/1321-pidEnquiryOverhaul
  • v2.20.1
  • v2.20.0
  • v2.19.0
  • v2.18.0
  • v2.17.0
  • v2.16.0
  • v2.15.0
  • v2.14.0
  • v2.13.0
  • v2.12.0
  • v2.11.0
  • v2.10.0
  • v2.9.0
  • v2.8.0
  • v2.7.0
  • v2.6.0
  • v2.5.0
  • v2.4.0
  • v2.3.0
  • v2.2.1
40 results

migrations

  • Clone with SSH
  • Clone with HTTPS
  • CoscineBot's avatar
    CoscineBot authored
    # [2.20.1](v2.20.0...v2.20.1) (2023-03-23)
    437d1d1e
    History

    Migrations Library

    📝 Overview

    The Migrations library for .NET simplifies SQL database migrations within Coscine by providing a set of migrations based on Fluent Migrator and an executable to start the migrations, enabling easy database schema updates and versioning while minimizing downtime and data loss.

    ⚙️ Configuration

    To install this library, you can use the NuGet package manager or you can install it using the .NET CLI.

    Install-Package Coscine.Migrations

    or using the .NET CLI

    dotnet add package Coscine.Migrations

    📖 Usage

    For examples on how we use this library, look into the source code of the following open-source Coscine APIs found in our public GitLab repository:

    • Project
    • Resources ... and others.

    Our custom executable (Coscine.Migrator.exe) also allows for the creation of the needed database.

    Migrating Up (update)

    Start a migration by calling Coscine.Migrator.exe --migrate_up. This will create the needed database and run all migrations. You can run the command again at a later time, to install additional migrations. Migrations already deployed will not be deployed again.

    Migrating down (revert)

    You can revert a migration by calling Coscine.Migrator.exe --roll_back 1. This will remove the most recent migration. Replacing the 1 with a 2 will revert the two most recent migrations and so on.

    The executable will create a connection string based on the Consul values:

    • DbDataSourceKey: coscine/global/db_data_source
    • DbNameKey: coscine/global/db_name
    • DbUserIdKey: coscine/global/db_user_id
    • DbPasswordKey: coscine/global/db_password

    Other uses

    You can call the migrations from a different project. The connection string information from Consul (except db_name) will be used. Use the CoscineMigrations class for this:

    // Setup the migrator class
    var targetAssembly = typeof(CoscineMigrations).Assembly;
    var migrator = new CoscineMigrations();
    var dbDatabase = "YOUR_DATABASE_NAME_HERE";
    migrator.SetServiceProvider(targetAssembly, migrator.GetDatabaseConnectionStringFromConsul(dbDatabase));
    
    // Create the database if needed
    migrator.EnsureDatabase(dbDatabase);
    // Run the migrations on the database
    migrator.MigrateUp();

    👥 Contributing

    As an open source plattform and project, we welcome contributions from our community in any form. You can do so by submitting bug reports or feature requests, or by directly contributing to Coscine's source code. To submit your contribution please follow our Contributing Guideline.

    📄 License

    The current open source repository is licensed under the MIT License, which is a permissive license that allows the software to be used, modified, and distributed for both commercial and non-commercial purposes, with limited restrictions (see LICENSE file)

    The MIT License allows for free use, modification, and distribution of the software and its associated documentation, subject to certain conditions. The license requires that the copyright notice and permission notice be included in all copies or substantial portions of the software. The software is provided "as is" without any warranties, and the authors or copyright holders cannot be held liable for any damages or other liability arising from its use.

    🆘 Support

    1. Check the documentation: Before reaching out for support, check the help pages provided by the team at https://docs.coscine.de/en/. This may have the information you need to solve the issue.
    2. Contact the team: If the documentation does not help you or if you have a specific question, you can reach out to our support team at servicedesk@itc.rwth-aachen.de 📧. Provide a detailed description of the issue you're facing, including any error messages or screenshots if applicable.
    3. Be patient: Our team will do their best to provide you with the support you need, but keep in mind that they may have a lot of requests to handle. Be patient and wait for their response.
    4. Provide feedback: If the support provided by our support team helps you solve the issue, let us know! This will help us improve our documentation and support processes for future users.

    By following these simple steps, you can get the support you need to use Coscine's services as an external user.

    📦 Release & Changelog

    External users can find the Releases and Changelog inside each project's repository. The repository contains a section for Releases (Deployments > Releases), where users can find the latest release changelog and source. Withing the Changelog you can find a list of all the changes made in that particular release and version.
    By regularly checking for new releases and changes in the Changelog, you can stay up-to-date with the latest improvements and bug fixes by our team and community!