Add schema copy func and test case