Skip to content

Commit

Permalink
Add seeds to Products
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinix committed Feb 10, 2024
1 parent 5f74c42 commit dc40696
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions priv/repo/seeds.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,30 @@
#
# We recommend using the bang functions (`insert!`, `update!`
# and so on) as they will fail if something goes wrong.

alias Pento.Catalog

products = [
%{
name: "Chess",
description: "The classic game of chess",
sku: 5_678_901,
unit_price: 10
},
%{
name: "Tic-Tac-Toe",
description: "The game of cats and dogs",
sku: 11_121_314,
unit_price: 3.00
},
%{
name: "Table Tennis",
description: "Bat and ball back and forth. Don't miss!",
sku: 15_222_324,
unit_price: 12.00
}
]

Enum.each(products, fn product ->
Catalog.create_product(product)
end)

0 comments on commit dc40696

Please sign in to comment.