Declare a version at the top of the domain and Caravela threads it through every generated artifact:

defmodule MyApp.Domains.Library do
  use Caravela.Domain

  version "v1"

  entity :books do
    field :title, :string, required: true
  end
end

What changes

LayerWithout versionWith version "v1"
Schema moduleMyApp.Library.BookMyApp.Library.V1.Book
Schema filelib/my_app/library/book.exlib/my_app/library/v1/book.ex
ContextMyApp.Library (lib/my_app/library.ex)MyApp.Library.V1 (lib/my_app/library/v1.ex)
ControllerMyAppWeb.BookControllerMyAppWeb.V1.BookController
Controller filelib/my_app_web/controllers/book_controller.exlib/my_app_web/controllers/v1/book_controller.ex
Router scopescope "/api", MyAppWeb doscope "/api/v1", MyAppWeb.V1 do
LiveViewMyAppWeb.Library.BookLive.IndexMyAppWeb.V1.Library.BookLive.Index
LiveView filelib/my_app_web/live/library/book_live/index.exlib/my_app_web/live/v1/library/book_live/index.ex
Svelte reflibrary/BookIndexv1/library/BookIndex
GraphQLMyAppWeb.Schema.LibraryTypesMyAppWeb.Schema.V1.LibraryTypes

What doesn't change

Table names. library_books stays library_books across versions. Different DSL versions share rows; renaming is a column/type concern, not a table concern. If a later version changes a column type, you write a bridging migration by hand (Caravela is deliberately stateless about schema evolution — see regeneration).

Multiple versions coexisting

To ship v2 alongside v1, duplicate the domain file and bump the string. mix caravela.gen will render a parallel tree under v2/ leaving v1 untouched.

# lib/my_app/domains/library_v1.ex
defmodule MyApp.Domains.LibraryV1 do
  use Caravela.Domain
  version "v1"
  # … unchanged …
end

# lib/my_app/domains/library_v2.ex
defmodule MyApp.Domains.LibraryV2 do
  use Caravela.Domain
  version "v2"
  # … new fields, new hooks …
end

Both versions generate into their own namespaces; your router has two scopes (/api/v1 and /api/v2); the database has one schema.

Compile-time guard

Version strings must match ~r/^v\d+$/. "version-1" or "V1" raise a CompileError at compile time.