DoubleEntryLedger.BaseSchema (double_entry_ledger v0.4.0)
View SourceThe DoubleEntryLedger.BaseSchema module provides a base schema configuration for all schemas in the DoubleEntryLedger project.
This module sets up common schema attributes such as primary key, foreign key type, and schema prefix.
It is intended to be used with the use macro in other schema modules to ensure consistency.
Usage
To use the BaseSchema in your schema module, simply add use DoubleEntryLedger.BaseSchema:
defmodule DoubleEntryLedger.SomeSchema do
use DoubleEntryLedger.BaseSchema
schema "some_table" do
field :name, :string
# ... other fields ...
end
endThis will automatically set up the primary key, foreign key type, and schema prefix for the SomeSchema module.