Skip to content

Create Postgres migration for graph schema and identity storage #100

Description

@wendellmva

Issue: Create Postgres migration for graph schema and identity storage

Summary

Create and run EF Core migrations in sourcelib to establish the complete database schema for the graph database including nodes, edges, types, properties, and graph-based identity storage.

Goals

  • Generate EF Core migration for all graph entities
  • Include identity/auth tables from graph-based identity work
  • Run migration against Postgres database
  • Verify schema correctness

Scope

  1. Create migration for core graph entities:
    • NodeTypes, EdgeTypes
    • Nodes, Edges
    • Properties (with discriminator support)
    • Indexes and constraints
  2. Include graph-based identity storage:
    • Users, Roles, Claims (as graph nodes/edges)
    • Login providers, Tokens, Refresh tokens
  3. Run migration against local Postgres instance
  4. Verify tables, indexes, and relationships
  5. Test basic CRUD operations

Acceptance Criteria

  • Migration files generated in sourcelib project
  • Migration runs successfully against Postgres
  • All tables created with correct schema
  • Indexes and foreign keys properly configured
  • Can perform basic CRUD operations on all entities
  • Identity data can be stored and retrieved from graph

Dependencies

  • Postgres database running locally or in dev environment
  • EF Core tools installed
  • GraphContext configured for Postgres

Technical Notes

  • Use Npgsql provider for Postgres
  • Ensure connection string is configured
  • Consider seed data for initial node/edge types
  • Document migration commands in README

Checklist

  • Configure Postgres connection string
  • Generate EF Core migration
  • Review migration SQL
  • Run migration against database
  • Verify schema in database
  • Test CRUD operations
  • Document migration process

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium prioritySP:55 story points (large)coreCore abstractionsdomainDomain/data layeref-coreEntity Framework Core

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions