diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..bdb0cab --- /dev/null +++ b/.gitattributes @@ -0,0 +1,17 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.github/ISSUE_TEMPLATE/bug.yaml b/.github/ISSUE_TEMPLATE/bug.yaml new file mode 100644 index 0000000..5c0579e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yaml @@ -0,0 +1,38 @@ +name: 🪲 Bug Report +description: File a bug report +title: "Something didn't work" +labels: ["bug", "triage"] +body: + - type: markdown + attributes: + value: | + For help with using the library and "how do I" please see the documentation or post on StackOverflow. + - type: checkboxes + attributes: + label: Is there an existing issue for this? + description: Please search to see if an issue already exists for the bug you encountered. + options: + - label: I have searched the existing issues + required: true + - type: input + id: version + attributes: + label: Library Version + description: Which version of the library did you find the bug in? + placeholder: 1.0.0 + validations: + required: true + - type: textarea + id: what-happened + attributes: + label: What happened? + description: Also tell us, what did you expect to happen? + placeholder: Tell us what you see! + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: shell diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..80422ee --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,10 @@ +blank_issues_enabled: false +contact_links: + - name: DbUp Core Issue Repo + url: https://github.com/DbUp/DbUp/issues + about: If the issue or bug is not specific to this provider raise an issue in the main repo + - name: DbUp Documentation + url: https://dbup.readthedocs.io/ + - name: StackOverflow DbUp tag + url: https://stackoverflow.com/questions/tagged/dbup + about: For "How do I" questions, please post on StackOverflow diff --git a/.github/ISSUE_TEMPLATE/enhancement.yaml b/.github/ISSUE_TEMPLATE/enhancement.yaml new file mode 100644 index 0000000..8361086 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/enhancement.yaml @@ -0,0 +1,27 @@ +name: 🆕 Enhancement +description: Suggest a new feature or enhancement +title: "Something new" +labels: ["enhancement", "triage"] +body: + - type: checkboxes + attributes: + label: Is there an existing issue for this? + description: Please search to see if an issue already exists for the bug you encountered. + options: + - label: I have searched the existing open and closed issues + required: true + - type: textarea + id: description + attributes: + label: Description + placeholder: Sell us the enhancement + validations: + required: true + - type: textarea + id: impact + attributes: + label: What is the impact? + description: How will this impact existing users? Is this a breaking change? Is this a common or edge use case? + placeholder: Describe the impact this enhancement would have + validations: + required: true diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..7299d19 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +version: 2 + +updates: + - package-ecosystem: "nuget" + directory: "/src/" + schedule: + interval: "weekly" + ignore: +# - dependency-name: "Foo*" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..495ce36 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,6 @@ +# Checklist +- [ ] I have read the [Contributing Guide](https://github.com/DbUp/DbUp/blob/master/CONTRIBUTING.md) +- [ ] I have checked to ensure this does not introduce an unintended breaking changes +- [ ] I have considered appropriate testing for my change + +# Description diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..18198a1 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,78 @@ +name: CI + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest # Use Ubuntu in v5.0 + + env: + DOTNET_NOLOGO: true + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Avoid pre-populating the NuGet package cache + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # all + + - name: Setup .NET 2.0 # Remove in v5.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 2.0.x + + - name: Setup .NET 8.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.0.x + + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0 + with: + versionSpec: '5.x' + + - name: Run GitVersion + id: gitversion + uses: gittools/actions/gitversion/execute@v0 + + - name: Display SemVer + run: | + echo "SemVer: $env:GitVersion_SemVer" + + - name: Add DbUp NuGet Source + run: dotnet nuget add source --name DbUp --username DbUp --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text https://nuget.pkg.github.com/DbUp/index.json + + - name: Restore + run: dotnet restore + working-directory: src + + - name: Build + run: dotnet build -c Release --no-restore /p:Version=$env:GitVersion_SemVer + working-directory: src + + - name: Test + run: dotnet test --no-build -c Release --logger trx --logger "console;verbosity=detailed" --results-directory ../artifacts + working-directory: src + + - name: Pack + run: dotnet pack --no-build -c Release -o ../artifacts /p:Version=$env:GitVersion_SemVer + working-directory: src + + - name: Push NuGet packages to GitHub Packages ⬆️ + working-directory: artifacts + run: dotnet nuget push *.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/DbUp/index.json" + + - name: Push NuGet packages to NuGet ⬆️ + if: ${{ steps.gitversion.outputs.preReleaseLabel == '' }} + working-directory: artifacts + run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json + + - name: Test Report 🧪 + uses: dorny/test-reporter@v1 + if: ${{ always() }} + with: + name: Tests + path: artifacts/*.trx + reporter: dotnet-trx diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ff117b8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,96 @@ +# Build Folders (you can keep bin if you'd like, to store dlls and pdbs) +bin +obj + +# mstest test results +TestResults + + +*.*[~] +*.swp +*.userprefs +*.test-cache +*.pidb +*.*scc +*.FileListAbsolute.txt +*.aps +*.bak +*.[Cc]ache +*.clw +*.eto +*.fb6lck +*.fbl6 +*.fbpInf +*.ilk +*.lib +*.log +*.ncb +*.nlb +*.obj +*.patch +*.pch +*.pdb +*.plg +*.[Pp]ublish.xml +*.rdl.data +*.sbr +*.scc +*.sig +*.sqlsuo +*.suo +*.svclog +*.tlb +*.tlh +*.tli +*.tmp +*.user +*.vshost.* +*DXCore.Solution +*_i.c +*_p.c +Ankh.Load +Backup* +CVS/ +PrecompiledWeb/ +UpgradeLog*.* +[Bb]in/ +[Dd]ebug/ +[Oo]bj/ +[Rr]elease/ +[Tt]humbs.db +test-results/ +_UpgradeReport_Files +_[Rr]e[Ss]harper.*/ +_TeamCity.*/ +hgignore[.-]* +ignore[.-]* +svnignore[.-]* +lint.db +src/FunnelWeb.Web/App_Data/ClientDependency +files\* +files/* +Files/* +Temp/* +build/Artifacts/ +build/Published/ +build/TestResult.xml +[pP]ublish +lib +packages + +.DS_Store +*.pidb +*.orig +src/packages/ +*.received.txt +src/_NCrunch_DbUp +*.received.cs +dbup*.nupkg +.idea + +src/.vs/ +project.lock.json +project.lock.json +project.lock.json +tools/ +artifacts/ diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000..c311488 --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1 @@ +mode: Mainline \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d71f018 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/DbUp/dbup-newprovider/CI/main)](https://github.com/DbUp/dbup-newprovider/actions/workflows/main.yml?query=branch%3Amain) +[![NuGet](https://img.shields.io/nuget/dt/dbup-newprovider.svg)](https://www.nuget.org/packages/dbup-newprovider) +[![NuGet](https://img.shields.io/nuget/v/dbup-newprovider.svg)](https://www.nuget.org/packages/dbup-newprovider) +[![Prerelease](https://img.shields.io/nuget/vpre/dbup-newprovider?color=orange&label=prerelease)](https://www.nuget.org/packages/dbup-newprovider) + +# DbUp NewProvider support +DbUp is a .NET library that helps you to deploy changes to SQL Server databases. It tracks which SQL scripts have been run already, and runs the change scripts that are needed to get your database up to date. + +## Getting Help +To learn more about DbUp check out the [documentation](https://dbup.readthedocs.io/en/latest/) + +Please only log issue related to NewProvider support in this repo. For cross cutting issues, please use our [main issue list](https://github.com/DbUp/DbUp/issues). + +# Contributing + +See the [readme in our main repo](https://github.com/DbUp/DbUp/blob/master/README.md) for how to get started and contribute. \ No newline at end of file diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..1502073 --- /dev/null +++ b/license.txt @@ -0,0 +1,7 @@ +Copyright (C) 2015 DbUp contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/.editorconfig b/src/.editorconfig new file mode 100644 index 0000000..3f25e8c --- /dev/null +++ b/src/.editorconfig @@ -0,0 +1,123 @@ +# To learn more about .editorconfig see https://aka.ms/editorconfigdocs +############################### +# Core EditorConfig Options # +############################### +# All files +[*] +indent_style = space +# Code files +[*.{cs,csx,vb,vbx}] +indent_size = 4 +insert_final_newline = true +charset = utf-8-bom +############################### +# .NET Coding Conventions # +############################### +[*.{cs,vb}] +# Organize usings +dotnet_sort_system_directives_first = true +# this. preferences +dotnet_style_qualification_for_field = false:silent +dotnet_style_qualification_for_property = false:silent +dotnet_style_qualification_for_method = false:silent +dotnet_style_qualification_for_event = false:silent +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:silent +dotnet_style_predefined_type_for_member_access = true:silent +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent +# Modifier preferences +dotnet_style_require_accessibility_modifiers = omit_if_default:silent +dotnet_style_readonly_field = true:suggestion +# Expression-level preferences +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent +dotnet_prefer_inferred_tuple_names = true:suggestion +dotnet_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_auto_properties = true:silent +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +############################### +# Naming Conventions # +############################### +# Style Definitions +dotnet_naming_style.pascal_case_style.capitalization = pascal_case +# Use PascalCase for constant fields +dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields +dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style +dotnet_naming_symbols.constant_fields.applicable_kinds = field +dotnet_naming_symbols.constant_fields.applicable_accessibilities = * +dotnet_naming_symbols.constant_fields.required_modifiers = const +############################### +# C# Coding Conventions # +############################### +[*.cs] +# var preferences +csharp_style_var_for_built_in_types = true:silent +csharp_style_var_when_type_is_apparent = true:silent +csharp_style_var_elsewhere = true:silent +# Expression-bodied members +csharp_style_expression_bodied_methods = when_on_single_line:none +csharp_style_expression_bodied_constructors = false:suggestion +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +# Pattern matching preferences +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +# Null-checking preferences +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion +# Modifier preferences +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion +# Expression-level preferences +csharp_prefer_braces = when_multiline:suggestion +csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_prefer_simple_default_expression = true:suggestion +csharp_style_pattern_local_over_anonymous_function = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +############################### +# C# Formatting Rules # +############################### +# New line preferences +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true +# Indentation preferences +csharp_indent_case_contents = true +csharp_indent_switch_labels = true +csharp_indent_labels = flush_left +# Space preferences +csharp_space_after_cast = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_around_binary_operators = before_and_after +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +# Wrapping preferences +csharp_preserve_single_line_statements = true +csharp_preserve_single_line_blocks = true +############################### +# VB Coding Conventions # +############################### +[*.vb] +# Modifier preferences +visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000..fb1c760 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,27 @@ + + + + + https://github.com/orgs/DbUp/people + https://github.com/DbUp/dbup-newprovider/releases + https://dbup.github.io + MIT + https://github.com/dbup-newprovider/dbup-newprovider.git + latest + true + + + + + + true + + + true + + + embedded + + + + diff --git a/src/Tests/Tests.csproj b/src/Tests/Tests.csproj new file mode 100644 index 0000000..ca51bd6 --- /dev/null +++ b/src/Tests/Tests.csproj @@ -0,0 +1,30 @@ + + + + net462;net8 + Tests + DbUp.NewProvider.Tests + true + + enable + $(NoWarn);NETSDK1138 + latest + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + diff --git a/src/dbup-icon.png b/src/dbup-icon.png new file mode 100644 index 0000000..004dec7 Binary files /dev/null and b/src/dbup-icon.png differ diff --git a/src/dbup-newprovider.sln b/src/dbup-newprovider.sln new file mode 100644 index 0000000..4d866c2 --- /dev/null +++ b/src/dbup-newprovider.sln @@ -0,0 +1,48 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dbup-newprovider", "dbup-newprovider\dbup-newprovider.csproj", "{2A7189BD-96CE-41CA-9100-E1B1DD10FF40}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{8CE634FE-6772-408E-9340-909F6218F8F7}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_", "_", "{2BB18839-D96E-4697-902D-1900A6B75F69}" + ProjectSection(SolutionItems) = preProject + ..\.gitattributes = ..\.gitattributes + ..\.gitignore = ..\.gitignore + ..\license.txt = ..\license.txt + ..\README.md = ..\README.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{62E5FE92-E288-4E09-964D-F92AF0E49131}" + ProjectSection(SolutionItems) = preProject + ..\.github\workflows\main.yml = ..\.github\workflows\main.yml + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{5DA19CA9-8039-46D6-B474-021943582785}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{77157734-01DA-4AA3-A15C-504013343B29}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + dbup-newprovider.sln.DotSettings = dbup-newprovider.sln.DotSettings + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2A7189BD-96CE-41CA-9100-E1B1DD10FF40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2A7189BD-96CE-41CA-9100-E1B1DD10FF40}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2A7189BD-96CE-41CA-9100-E1B1DD10FF40}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2A7189BD-96CE-41CA-9100-E1B1DD10FF40}.Release|Any CPU.Build.0 = Release|Any CPU + {8CE634FE-6772-408E-9340-909F6218F8F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8CE634FE-6772-408E-9340-909F6218F8F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8CE634FE-6772-408E-9340-909F6218F8F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8CE634FE-6772-408E-9340-909F6218F8F7}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {62E5FE92-E288-4E09-964D-F92AF0E49131} = {5DA19CA9-8039-46D6-B474-021943582785} + {77157734-01DA-4AA3-A15C-504013343B29} = {2BB18839-D96E-4697-902D-1900A6B75F69} + {5DA19CA9-8039-46D6-B474-021943582785} = {2BB18839-D96E-4697-902D-1900A6B75F69} + EndGlobalSection +EndGlobal diff --git a/src/dbup-newprovider.sln.DotSettings b/src/dbup-newprovider.sln.DotSettings new file mode 100644 index 0000000..2c78c0a --- /dev/null +++ b/src/dbup-newprovider.sln.DotSettings @@ -0,0 +1,9 @@ + + DO_NOT_SHOW + Implicit + Implicit + SQ + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <data><IncludeFilters /><ExcludeFilters /></data> + <data /> \ No newline at end of file diff --git a/src/dbup-newprovider/dbup-newprovider.csproj b/src/dbup-newprovider/dbup-newprovider.csproj new file mode 100644 index 0000000..39d07a7 --- /dev/null +++ b/src/dbup-newprovider/dbup-newprovider.csproj @@ -0,0 +1,37 @@ + + + + DbUp makes it easy to deploy and upgrade SQL Server databases. This package adds Amazon NewProvider support. + DbUp NewProvider Support + netstandard1.3;netstandard2.0;net35;net45 + dbup-newprovider + DbUp.NewProvider + ../dbup.snk + true + https://github.com/DbUp/dbup-newprovider.git + dbup_newprovider + dbup-newprovider + dbup-icon.png + + + + $(DefineConstants);NPGSQLv2 + + + + + + + + + + + + + + + + + + + diff --git a/src/dbup.snk b/src/dbup.snk new file mode 100644 index 0000000..1a7adc6 Binary files /dev/null and b/src/dbup.snk differ