Coder Social home page Coder Social logo

ecto_sql's People

Contributors

aawalton avatar adrianomitre avatar almirsarajcic avatar anber avatar aptinio avatar arcz avatar bartekupartek avatar bforchhammer avatar bgentry avatar chulkilee avatar danadaldos avatar davidkuhta avatar davidsulc avatar eiji7 avatar elarkham avatar fertapric avatar gj avatar gregmefford avatar halostatue avatar hogjosh avatar iangreenleaf avatar joaothallis avatar josevalim avatar mjaric avatar mracos avatar pmargreff avatar qcam avatar ulissesalmeida avatar webdeb avatar wojtekmach avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ecto_sql's Issues

Could not create schema migrations table error

Environment

  • Elixir version (elixir -v):
Erlang/OTP 21 [erts-10.2] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]

Elixir 1.9.4 (compiled with Erlang/OTP 20)
  • Database and version (PostgreSQL 9.4, MongoDB 3.2, etc.):
    SQL Server 12.0.6024

  • Ecto version (mix deps):

ecto 3.3.2 (Hex package) (mix)
  locked at 3.3.2 (ecto) 002aa428
  • Database adapter and version (mix deps):
* tds 2.1.0 (https://github.com/livehelpnow/tds) (mix)
  locked at 90bb001 (branch: master)
  ok
* ecto_sql 3.3.2 (https://github.com/mjaric/ecto_sql) (mix)
  locked at 035017b (branch: tds-support)
  ok
  • Operating system:

Windows 10

Current behavior

When I'm starting from a fresh database (the database has been created, but no tables exist) and run mix ecto.reset I get the following error. The strange thing, is that the "schema_migrations" table does get created, but nothing else happens.

15:42:11.353 [error] Could not create schema migrations table. This error usually happens due to the following:

  * The database does not exist
  * The "schema_migrations" table, which Ecto uses for managing
    migrations, was defined by another library
  * There is a deadlock while migrating (such as using concurrent
    indexes with a migration_lock)

To fix the first issue, run "mix ecto.create".

To address the second, you can run "mix ecto.drop" followed by
"mix ecto.create". Alternatively you may configure Ecto to use
another table for managing migrations:

    config :rti, Rti.Repo,
      migration_source: "some_other_table_for_schema_migrations"

The full error report is shown below.

** (Tds.Error) Line 1 (Error 2714): There is already an object named 'schema_migrations' in the database.
    (ecto_sql) lib/ecto/adapters/sql.ex:629: Ecto.Adapters.SQL.raise_sql_call_error/1
    (elixir) lib/enum.ex:1336: Enum."-map/2-lists^map/1-0-"/2
    (ecto_sql) lib/ecto/adapters/sql.ex:719: Ecto.Adapters.SQL.execute_ddl/4
    (ecto_sql) lib/ecto/migrator.ex:635: Ecto.Migrator.verbose_schema_migration/3
    (ecto_sql) lib/ecto/migrator.ex:479: Ecto.Migrator.lock_for_migrations/4
    (ecto_sql) lib/ecto/migrator.ex:613: anonymous fn/5 in Ecto.Migrator.migrate/4
    (elixir) lib/enum.ex:1948: Enum."-reduce/3-lists^foldl/2-0-"/3
    (ecto_sql) lib/ecto/migrator.ex:612: Ecto.Migrator.migrate/4
    (ecto_sql) lib/ecto/migrator.ex:149: Ecto.Migrator.with_repo/3
    (ecto_sql) lib/mix/tasks/ecto.migrate.ex:117: anonymous fn/5 in Mix.Tasks.Ecto.Migrate.run/2
    (elixir) lib/enum.ex:1948: Enum."-reduce/3-lists^foldl/2-0-"/3
    (ecto_sql) lib/mix/tasks/ecto.migrate.ex:105: Mix.Tasks.Ecto.Migrate.run/2
    (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
    (mix) lib/mix/task.ex:365: Mix.Task.run_alias/3
    (mix) lib/mix/task.ex:292: Mix.Task.run/2
    (mix) lib/mix/task.ex:365: Mix.Task.run_alias/3
    (mix) lib/mix/task.ex:292: Mix.Task.run/2
    (mix) lib/mix/cli.ex:79: Mix.CLI.run_task/2

Expected behavior

After the migrations table was created, I exected the migrations that are defined to get executed.

Additional Information

I'm migrating from using mssqlex/mssql_ecto where the migrations worked. I'm not sure if that's helpful information or not, but I thought I'd mention it just in case.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.