Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not support multi schema in one project #3511

Open
IronRobot opened this issue Oct 29, 2024 · 0 comments
Open

Not support multi schema in one project #3511

IronRobot opened this issue Oct 29, 2024 · 0 comments

Comments

@IronRobot
Copy link

Expected behavior

Success init all schema and tables

Actual behavior

Got a permission denied error

Steps to reproduce

Define model classes

@Entity(name = "A")
@Table(name = "A", schema = "A")
public class A {
    @Id
    private int id;

    private String name;
    
    // getter & setter ...

}

@Entity(name = "B")
@Table(name = "B", schema = "B")
public class B {
    @Id
    private int id;

    private String name;
    
    // getter & setter ...

}

declare application-test.yaml

ebean:
  test:
    shutdown: remove
    platform: mysql
    ddlMode: dropCreate
    dbName: A      # here I can't declare multi dbName

As the log show, it only create database A and only grant permissions On A.* to user A

  // some logging output

2024-10-29 09:46:42 [ForkJoinPool.commonPool-worker-2] TRACE io.ebean.test.containers - sqlRun: show databases like 'A'
2024-10-29 09:46:42 [ForkJoinPool.commonPool-worker-2] DEBUG io.ebean.test.containers - sqlRun: create database A
2024-10-29 09:46:42 [ForkJoinPool.commonPool-worker-2] DEBUG io.ebean.test.containers - sqlRun: set global log_bin_trust_function_creators=1
2024-10-29 09:46:42 [ForkJoinPool.commonPool-worker-2] TRACE io.ebean.test.containers - sqlRun: select User from user where User = 'A'
2024-10-29 09:46:42 [ForkJoinPool.commonPool-worker-2] DEBUG io.ebean.test.containers - sqlRun: create user 'A'@'%' identified by 'test'
2024-10-29 09:46:42 [ForkJoinPool.commonPool-worker-2] DEBUG io.ebean.test.containers - sqlRun: grant all on A.* to 'A'@'%'

Caused by: java.sql.SQLException: Error executing [create table B.B (
  id                            integer auto_increment not null,
  name                          varchar(255),
  constraint pk_b primary key (id)
)] error[CREATE command denied to user 'A'@'192.168.65.1' for table 'B']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant