Comments (6)
from ecto_sql.
Quick question: does it work with --step instead of -n?
Nope, the argument is also ignored with mix ecto.migrate --step 1
🙁
from ecto_sql.
Hi @bgentry, unfortunately I cannot reproduce this using latest ecto and ecto_sql. I just started a new Phoenix app, created two different resources and did this:
~/OSS/phoenix/installer/demo[master %]$ mix ecto.migrate -n 1
[debug] QUERY OK source="schema_migrations" db=0.3ms
SELECT s0."version"::bigint FROM "schema_migrations" AS s0 FOR UPDATE []
[info] == Running 20181222002903 Demo.Repo.Migrations.CreateUsers.change/0 forward
[info] create table users
[info] == Migrated 20181222002903 in 0.0s
~/OSS/phoenix/installer/demo[master %]$ mix ecto.migrate -n 1
[debug] QUERY OK source="schema_migrations" db=0.8ms
SELECT s0."version"::bigint FROM "schema_migrations" AS s0 FOR UPDATE []
[info] == Running 20181222002912 Demo.Repo.Migrations.CreatePosts.change/0 forward
[info] create table posts
[info] == Migrated 20181222002912 in 0.0s
Have you tried using latest ecto_sql
and checked if the problem persists? If so, can you prodice a way to reproduce it? Thanks.
from ecto_sql.
@josevalim ahh, sorry to waste your time on this 🤦♂️ I suspect it must be due to this alias in our mix.exs
:
defp aliases do
[
"ecto.migrate": ["ecto.migrate", "ecto.dump"],
..
]
end
I guess I'll have to come up with a different way to achieve that, one that doesn't swallow args.
from ecto_sql.
I have changed master to perform strict argument parsing, which we should have been doing along time ago:
$ mix ecto.dump -n 1
** (Mix) Could not invoke task "ecto.dump": 1 error found!
-n : Unknown option
Btw, you can change your alias to this:
def aliases do
["ecto.migrate": &migrate_and_dump/1]
end
defp migrate_and_dump(args) do
Mix.Task.run "ecto.migrate", args
Mix.Task.run "ecto.dump"
end
from ecto_sql.
@josevalim brilliant idea, thanks! Explicit rejection of invalid args will help prevent others from running into this class of problem. And also, thanks for the solution 😄
from ecto_sql.
Related Issues (20)
- Ecto.Query.API.type(true, :boolean) generates invalid MySQL query HOT 4
- ecto.dump adding create/drop/use statements HOT 8
- `:comment` option causes an error when migrating `remove/3` forward HOT 1
- Starting a transaction on MSSQL 2012 fails HOT 5
- Error when trying to insert data into tables using System Versioning tables with MariaDB HOT 4
- `TABLESAMPLE` hint has a working test, but is not actually supported by the Postgres adapter HOT 3
- Ecto.Migration.remove/3 incorrectly passes primary_key DOWN option during UP operation HOT 2
- Optimize `IN` expression in PostgreSQL HOT 1
- Raw SQL Regex Issue with Ecto.Migration#execute/1 HOT 2
- Migration `execute` behavior possibly undocumented HOT 6
- Unable to set sqlite PRAGMA in migrations HOT 16
- References inside a prefixed table cannot reference an unprefixed table HOT 13
- could not cancel backend errors HOT 5
- Warn on `.ex` files in `priv/repo/migrations` HOT 1
- Logger.put_module_level does not silence preloads HOT 4
- `in` operator produces invalid SQL when used with a MySQL JSON array HOT 2
- Creating index on a column named as a reserved word HOT 6
- could not compile dependency :ecto, "mix compile" failed HOT 6
- Using map.field notation (without parentheses) to invoke function is deprecated HOT 4
- Migrator error: ** (MatchError) no match of right hand side value: :ok HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ecto_sql.