Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

This page describes "alpha" quality code and processes. It is intended to provide an early look into the Project Roadrunner: PostgreSQL Support for the Ed-Fi ODS / API development process and elicit feedback. As such, full release functionality could end up differing substantially from the code described herein.

What's New

EdFi.Db.Deploy

Summary of key enhancements with this release:

  1. Install as a dotnet tool
  2. Changed the execution syntax to use verbs (examples below)
  3. Now contains full Admin and Security databases
  4. Support for deploying Change Queries as a feature
  5. Support for deploying extensions
  6. Support for testing if any migration scripts need to be run, using whatif  verb.

Installing Alpha 2

See readme for more details.

...

Note

With this release, when installing as a .NET Tool, there is no config file deployed. Currently the application is logging with log4net, and without a config file, the messages are not displayed to the console. Save the following to as log4net.config  in path ~/.dotnet/tools or alternately save it in a local directory and install the tool in that directory, using the --tool-path  argument in the command above.

Code Block
languagexml
titlelog4net.config
<?xml version="1.0" encoding="utf-8"?>
<log4net>
  <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
    <threshold value="INFO" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date [%thread] %-5level %logger{1} - %message%newline" />
    </layout>
  </appender>
  <appender name="FileAppender" type="log4net.Appender.FileAppender">
    <threshold value="DEBUG" />
    <file value="Ed-Fi-Db-Deploy.log" />
    <appendToFile value="true" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date [%thread] %-5level %logger{1} - %message%newline" />
    </layout>
  </appender>
  <root>
    <appender-ref ref="ConsoleAppender" />
    <appender-ref ref="FileAppender" />
  </root>
</log4net>



New Deploy Verb

For detailed examples, run the tool with no arguments provided and view the output, or see the readme.

...

Code Block
EdFi.Db.Deploy deploy -d Admin -c "server=localhost;database=EdFi_Admin;username=…;password=…" -p PostgreSQL

Installing Change Queries

Change queries support is only for SQL Server at this time. Use argument -f Changes  to install.

Code Block
EdFi.Db.Deploy deploy -d ODS -c "server=localhost;database=EdFi_ODS;integrated security=sspi" -p SqlServer -f Changes

Installing Extensions

While RoadRunner will not officially support extensions, this tool will be incorporated into initdev in the near future and must be able to install extensions for SQL Server-based ODS implementations. Use argument -x  to deploy extensions, providing a list of "supporting artifacts" directories.

Code Block
$supportingArtifacts = @(
  "C:\Source\3.x\Ed-Fi-Ods-Implementation\Application\EdFi.Ods.Extensions.GrandBend\SupportingArtifacts\Database",
  "C:\Source\3.x\Ed-Fi-Ods-Implementation\Application\EdFi.Ods.Extensions.Sample\SupportingArtifacts\Database"
)

EdFi.Db.Deploy deploy -d ODS -c "server=localhost;database=EdFi_ODS;integrated security=sspi" -p SqlServer -x $supportingArtifacts

WhatIf Verb

The whatif  verb checks to see if any scripts need to be installed without performing the installation. This functionality was added to support scenarios where you want to run a task before deploying new migration scripts to the database (e.g. run a backup). Exits with status code 1 if there are migration scripts to execute and 0 otherwise.

Code Block
EdFi.Db.Deploy whatif -d ODS -c "server=localhost;database=EdFi_ODS;integrated security=sspi" -p SqlServer

# Check $LASTEXITCODE for 1 or 0

ODS/API

Authentication an authorization are now working on PostgreSQL. Check out the roadrunner-alpha2  tags in the three repositories Ed-Fi-Common, Ed-Fi-ODS, and Ed-Fi-ODS-Implementation. Be sure to install all three databases in PostgreSQL using the alpha 2 version of the DB Deploy tool (described above). If starting the ODS/API from Visual Studio, switch to the new "Npgsql" build configuration 

...

Code Block
titlePost to AcademicWeek
POST http://localhost:54576/data/v3/ed-fi/academicWeeks HTTP/1.1
Host: localhost:54746
Content-Type: application/json
Authorization: Bearer b519347ee4df46a1808ccf2b07a3db27
Content-Length: 332

{
  "weekIdentifier": "asdfasdfasdf5",
  "schoolReference": {
    "schoolId": 255901001
  },
  "beginDate": "2011-02-22",
  "endDate": "2019-02-28",
  "totalInstructionalDays": 0
}

Coming Soon

  • NHibernate mappings for the ODS database on PostgreSQL.
  • Populated and minimal template data sets for PostgreSQL.

Providing Feedback

Have feedback on this pre-release code? Three available channels:

...