added migrations, command and fixes