zulkris

zulkris

Ecto dont creates table but migration success

Hi all! for clarify i upload all to github
to start:
docker-compose up -d
inside container (via docker exec -it app sh), im trying migrate via mix ecto.migrate

migration “successfully” migrates:

❯ docker exec -it app sh
/spool/services/poller_dal $ mix ecto.rollback
21:56:56.054 [info]  == Running 20230224150122 PollerDal.Repo.Migrations.CreateDistricts.change/0 backward
21:56:56.056 [info]  == Migrated 20230224150122 in 0.0s
/spool/services/poller_dal $ mix ecto.migrate
21:57:01.036 [info]  == Running 20230224150122 PollerDal.Repo.Migrations.CreateDistricts.change/0 forward
21:57:01.038 [info]  == Migrated 20230224150122 in 0.0s

but new table not creates

P.S.: in schema_migrations successfully added new line that this migration migrates “ok”

Marked As Solved

muelthe

muelthe

It looks to me like your migration file is empty.

There’s some good reference here in the docs for building a migration file: Ecto.Migration — Ecto SQL v3.14.0

Also, you might find the following useful when you create your schemas: mix phx.gen.schema — Phoenix v1.6.4

This particular mix task will create and populate the migration file as well (edit: along with the schema of course :slight_smile: ).

Also Liked

zulkris

zulkris

wow, i see its real empty in repo… O____O i understood))

this file under ReadOnly rights until it creates via mix ecto.gen.migration xxxx and he starts under root under container =) i see modified version, but i have no rights…

thanks a lot)) so simple…

Where Next?

Popular in Questions Top

WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

Other popular topics Top

marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39523 209
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement